Fossil SCM

Fix memory leak in the new TH1 artifact command.

mistachkin 2014-06-16 18:34 trunk
Commit 74099a5c8dd5ef30a56d03e8070eaff92980526c
1 file changed +1
--- src/th_main.c
+++ src/th_main.c
@@ -807,10 +807,11 @@
807807
int rid;
808808
Blob content;
809809
rid = name_to_rid(argv[1]);
810810
if( rid!=0 && content_get(rid, &content) ){
811811
Th_SetResult(interp, blob_str(&content), blob_size(&content));
812
+ blob_reset(&content);
812813
return TH_OK;
813814
}else{
814815
Th_SetResult(interp, "artifact not found", -1);
815816
return TH_ERROR;
816817
}
817818
--- src/th_main.c
+++ src/th_main.c
@@ -807,10 +807,11 @@
807 int rid;
808 Blob content;
809 rid = name_to_rid(argv[1]);
810 if( rid!=0 && content_get(rid, &content) ){
811 Th_SetResult(interp, blob_str(&content), blob_size(&content));
 
812 return TH_OK;
813 }else{
814 Th_SetResult(interp, "artifact not found", -1);
815 return TH_ERROR;
816 }
817
--- src/th_main.c
+++ src/th_main.c
@@ -807,10 +807,11 @@
807 int rid;
808 Blob content;
809 rid = name_to_rid(argv[1]);
810 if( rid!=0 && content_get(rid, &content) ){
811 Th_SetResult(interp, blob_str(&content), blob_size(&content));
812 blob_reset(&content);
813 return TH_OK;
814 }else{
815 Th_SetResult(interp, "artifact not found", -1);
816 return TH_ERROR;
817 }
818

Keyboard Shortcuts

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