Fossil SCM
Clean up g.non-const zXYZ members in the atexit handler. Add a blob_reset() in finish_tag() to cover the case that fast_insert_content() does not reset it.
Commit
252ca35f47a91f27846926f99362a376aae3d392e77236df3a15fd7f5bb4d8db
Parent
4566da665ddb4b5…
2 files changed
+1
+20
-1
+1
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -226,10 +226,11 @@ | ||
| 226 | 226 | blob_appendf(&record, "\nU %F\n", gg.zUser); |
| 227 | 227 | md5sum_blob(&record, &cksum); |
| 228 | 228 | blob_appendf(&record, "Z %b\n", &cksum); |
| 229 | 229 | fast_insert_content(&record, 0, 0, 1); |
| 230 | 230 | blob_reset(&cksum); |
| 231 | + blob_reset(&record); | |
| 231 | 232 | } |
| 232 | 233 | import_reset(0); |
| 233 | 234 | } |
| 234 | 235 | |
| 235 | 236 | /* |
| 236 | 237 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -226,10 +226,11 @@ | |
| 226 | blob_appendf(&record, "\nU %F\n", gg.zUser); |
| 227 | md5sum_blob(&record, &cksum); |
| 228 | blob_appendf(&record, "Z %b\n", &cksum); |
| 229 | fast_insert_content(&record, 0, 0, 1); |
| 230 | blob_reset(&cksum); |
| 231 | } |
| 232 | import_reset(0); |
| 233 | } |
| 234 | |
| 235 | /* |
| 236 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -226,10 +226,11 @@ | |
| 226 | blob_appendf(&record, "\nU %F\n", gg.zUser); |
| 227 | md5sum_blob(&record, &cksum); |
| 228 | blob_appendf(&record, "Z %b\n", &cksum); |
| 229 | fast_insert_content(&record, 0, 0, 1); |
| 230 | blob_reset(&cksum); |
| 231 | blob_reset(&record); |
| 232 | } |
| 233 | import_reset(0); |
| 234 | } |
| 235 | |
| 236 | /* |
| 237 |
+20
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -360,14 +360,33 @@ | ||
| 360 | 360 | #endif |
| 361 | 361 | #ifdef FOSSIL_ENABLE_JSON |
| 362 | 362 | cson_value_free(g.json.gc.v); |
| 363 | 363 | memset(&g.json, 0, sizeof(g.json)); |
| 364 | 364 | #endif |
| 365 | - free(g.zErrMsg); | |
| 366 | 365 | if(g.db){ |
| 367 | 366 | db_close(0); |
| 368 | 367 | } |
| 368 | + fossil_free(g.ckinLockFail); | |
| 369 | + fossil_free(g.zAuxSchema); | |
| 370 | + fossil_free(g.zBaseURL); | |
| 371 | + fossil_free(g.zConfigDbName); | |
| 372 | + fossil_free(g.zErrMsg); | |
| 373 | + fossil_free(g.zExtra); | |
| 374 | + fossil_free(g.zHttpAuth); | |
| 375 | + fossil_free(g.zHttpsURL); | |
| 376 | + fossil_free(g.zIpAddr); | |
| 377 | + fossil_free(g.zLocalDbName); | |
| 378 | + fossil_free(g.zLocalRoot); | |
| 379 | + fossil_free(g.zNonce); | |
| 380 | + fossil_free(g.zOpenRevision); | |
| 381 | + fossil_free(g.zPath); | |
| 382 | + fossil_free(g.zRepositoryName); | |
| 383 | + fossil_free(g.zRepositoryOption); | |
| 384 | + fossil_free(g.zSshCmd); | |
| 385 | + fossil_free(g.zTop); | |
| 386 | + /* TODO: clean up the file-local content.c::contentCache | |
| 387 | + ** via new function in that file */ | |
| 369 | 388 | /* |
| 370 | 389 | ** FIXME: The next two lines cannot always be enabled; however, they |
| 371 | 390 | ** are very useful for tracking down TH1 memory leaks. |
| 372 | 391 | */ |
| 373 | 392 | if( fossil_getenv("TH1_DELETE_INTERP")!=0 ){ |
| 374 | 393 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -360,14 +360,33 @@ | |
| 360 | #endif |
| 361 | #ifdef FOSSIL_ENABLE_JSON |
| 362 | cson_value_free(g.json.gc.v); |
| 363 | memset(&g.json, 0, sizeof(g.json)); |
| 364 | #endif |
| 365 | free(g.zErrMsg); |
| 366 | if(g.db){ |
| 367 | db_close(0); |
| 368 | } |
| 369 | /* |
| 370 | ** FIXME: The next two lines cannot always be enabled; however, they |
| 371 | ** are very useful for tracking down TH1 memory leaks. |
| 372 | */ |
| 373 | if( fossil_getenv("TH1_DELETE_INTERP")!=0 ){ |
| 374 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -360,14 +360,33 @@ | |
| 360 | #endif |
| 361 | #ifdef FOSSIL_ENABLE_JSON |
| 362 | cson_value_free(g.json.gc.v); |
| 363 | memset(&g.json, 0, sizeof(g.json)); |
| 364 | #endif |
| 365 | if(g.db){ |
| 366 | db_close(0); |
| 367 | } |
| 368 | fossil_free(g.ckinLockFail); |
| 369 | fossil_free(g.zAuxSchema); |
| 370 | fossil_free(g.zBaseURL); |
| 371 | fossil_free(g.zConfigDbName); |
| 372 | fossil_free(g.zErrMsg); |
| 373 | fossil_free(g.zExtra); |
| 374 | fossil_free(g.zHttpAuth); |
| 375 | fossil_free(g.zHttpsURL); |
| 376 | fossil_free(g.zIpAddr); |
| 377 | fossil_free(g.zLocalDbName); |
| 378 | fossil_free(g.zLocalRoot); |
| 379 | fossil_free(g.zNonce); |
| 380 | fossil_free(g.zOpenRevision); |
| 381 | fossil_free(g.zPath); |
| 382 | fossil_free(g.zRepositoryName); |
| 383 | fossil_free(g.zRepositoryOption); |
| 384 | fossil_free(g.zSshCmd); |
| 385 | fossil_free(g.zTop); |
| 386 | /* TODO: clean up the file-local content.c::contentCache |
| 387 | ** via new function in that file */ |
| 388 | /* |
| 389 | ** FIXME: The next two lines cannot always be enabled; however, they |
| 390 | ** are very useful for tracking down TH1 memory leaks. |
| 391 | */ |
| 392 | if( fossil_getenv("TH1_DELETE_INTERP")!=0 ){ |
| 393 |