Fossil SCM
Fix memory leak in the new TH1 artifact command.
Commit
74099a5c8dd5ef30a56d03e8070eaff92980526c
Parent
109d8f5dd67e0de…
1 file changed
+1
+1
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -807,10 +807,11 @@ | ||
| 807 | 807 | int rid; |
| 808 | 808 | Blob content; |
| 809 | 809 | rid = name_to_rid(argv[1]); |
| 810 | 810 | if( rid!=0 && content_get(rid, &content) ){ |
| 811 | 811 | Th_SetResult(interp, blob_str(&content), blob_size(&content)); |
| 812 | + blob_reset(&content); | |
| 812 | 813 | return TH_OK; |
| 813 | 814 | }else{ |
| 814 | 815 | Th_SetResult(interp, "artifact not found", -1); |
| 815 | 816 | return TH_ERROR; |
| 816 | 817 | } |
| 817 | 818 |
| --- 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 |