Fossil SCM

Fix a large memory leak in the "fossil reconstruct" command. Ticket [fc1a61329403f605c494]

drh 2010-09-09 10:02 trunk
Commit 9ef4a184f4b1aa6ae7b9635ec2b0c7a325043df5
1 file changed +2
--- src/rebuild.c
+++ src/rebuild.c
@@ -446,10 +446,12 @@
446446
blob_appendf(&path, "%s/%s", g.argv[3], pEntry->d_name);
447447
if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){
448448
fossil_panic("Some unknown error occurred while reading \"%s\"", blob_str(&path));
449449
}
450450
content_put(&aContent, 0, 0);
451
+ blob_reset(&path);
452
+ blob_reset(&aContent);
451453
}
452454
}
453455
else {
454456
fossil_panic("Encountered error %d while trying to open \"%s\".", errno, g.argv[3]);
455457
}
456458
--- src/rebuild.c
+++ src/rebuild.c
@@ -446,10 +446,12 @@
446 blob_appendf(&path, "%s/%s", g.argv[3], pEntry->d_name);
447 if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){
448 fossil_panic("Some unknown error occurred while reading \"%s\"", blob_str(&path));
449 }
450 content_put(&aContent, 0, 0);
 
 
451 }
452 }
453 else {
454 fossil_panic("Encountered error %d while trying to open \"%s\".", errno, g.argv[3]);
455 }
456
--- src/rebuild.c
+++ src/rebuild.c
@@ -446,10 +446,12 @@
446 blob_appendf(&path, "%s/%s", g.argv[3], pEntry->d_name);
447 if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){
448 fossil_panic("Some unknown error occurred while reading \"%s\"", blob_str(&path));
449 }
450 content_put(&aContent, 0, 0);
451 blob_reset(&path);
452 blob_reset(&aContent);
453 }
454 }
455 else {
456 fossil_panic("Encountered error %d while trying to open \"%s\".", errno, g.argv[3]);
457 }
458

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button