Fossil SCM
Corrected potential mishandling of memory ownership in the previous commit.
Commit
d6e698c2657b41a975d8e29203ba8e92b91b41d4f30926644cdac641148c75f9
Parent
852be6d4200a0c0…
1 file changed
+2
-2
+2
-2
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2345,12 +2345,12 @@ | ||
| 2345 | 2345 | ** |
| 2346 | 2346 | ** Use the contents of FILENAME as the value of the site's |
| 2347 | 2347 | ** "mainmenu" setting, overriding the contents (for this |
| 2348 | 2348 | ** request) of the db-side setting or the hard-coded default. |
| 2349 | 2349 | */ |
| 2350 | - g.zMainMenuFile = blob_str(&value); | |
| 2351 | - value = empty_blob/*take over ownership*/; | |
| 2350 | + g.zMainMenuFile = mprintf("%s", blob_str(&value)); | |
| 2351 | + blob_reset(&value); | |
| 2352 | 2352 | continue; |
| 2353 | 2353 | } |
| 2354 | 2354 | if( blob_eq(&key, "cgi-debug:") && blob_token(&line, &value) ){ |
| 2355 | 2355 | /* cgi-debug: FILENAME |
| 2356 | 2356 | ** |
| 2357 | 2357 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2345,12 +2345,12 @@ | |
| 2345 | ** |
| 2346 | ** Use the contents of FILENAME as the value of the site's |
| 2347 | ** "mainmenu" setting, overriding the contents (for this |
| 2348 | ** request) of the db-side setting or the hard-coded default. |
| 2349 | */ |
| 2350 | g.zMainMenuFile = blob_str(&value); |
| 2351 | value = empty_blob/*take over ownership*/; |
| 2352 | continue; |
| 2353 | } |
| 2354 | if( blob_eq(&key, "cgi-debug:") && blob_token(&line, &value) ){ |
| 2355 | /* cgi-debug: FILENAME |
| 2356 | ** |
| 2357 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2345,12 +2345,12 @@ | |
| 2345 | ** |
| 2346 | ** Use the contents of FILENAME as the value of the site's |
| 2347 | ** "mainmenu" setting, overriding the contents (for this |
| 2348 | ** request) of the db-side setting or the hard-coded default. |
| 2349 | */ |
| 2350 | g.zMainMenuFile = mprintf("%s", blob_str(&value)); |
| 2351 | blob_reset(&value); |
| 2352 | continue; |
| 2353 | } |
| 2354 | if( blob_eq(&key, "cgi-debug:") && blob_token(&line, &value) ){ |
| 2355 | /* cgi-debug: FILENAME |
| 2356 | ** |
| 2357 |