Fossil SCM
Fix memory leak in the 'info commands' and 'info vars' TH1 sub-commands. Reported to the mailing list by Sergei Gavrikov.
Commit
1079c2459b8c1539c23e4fa8026d78abe691c6e7
Parent
76412c68f146f48…
1 file changed
+2
+2
| --- src/th_lang.c | ||
| +++ src/th_lang.c | ||
| @@ -920,10 +920,11 @@ | ||
| 920 | 920 | rc = Th_ListAppendCommands(interp, &zElem, &nElem); |
| 921 | 921 | if( rc!=TH_OK ){ |
| 922 | 922 | return rc; |
| 923 | 923 | } |
| 924 | 924 | Th_SetResult(interp, zElem, nElem); |
| 925 | + if( zElem ) Th_Free(interp, zElem); | |
| 925 | 926 | return TH_OK; |
| 926 | 927 | } |
| 927 | 928 | |
| 928 | 929 | /* |
| 929 | 930 | ** TH Syntax: |
| @@ -943,10 +944,11 @@ | ||
| 943 | 944 | rc = Th_ListAppendVariables(interp, &zElem, &nElem); |
| 944 | 945 | if( rc!=TH_OK ){ |
| 945 | 946 | return rc; |
| 946 | 947 | } |
| 947 | 948 | Th_SetResult(interp, zElem, nElem); |
| 949 | + if( zElem ) Th_Free(interp, zElem); | |
| 948 | 950 | return TH_OK; |
| 949 | 951 | } |
| 950 | 952 | |
| 951 | 953 | /* |
| 952 | 954 | ** TH Syntax: |
| 953 | 955 |
| --- src/th_lang.c | |
| +++ src/th_lang.c | |
| @@ -920,10 +920,11 @@ | |
| 920 | rc = Th_ListAppendCommands(interp, &zElem, &nElem); |
| 921 | if( rc!=TH_OK ){ |
| 922 | return rc; |
| 923 | } |
| 924 | Th_SetResult(interp, zElem, nElem); |
| 925 | return TH_OK; |
| 926 | } |
| 927 | |
| 928 | /* |
| 929 | ** TH Syntax: |
| @@ -943,10 +944,11 @@ | |
| 943 | rc = Th_ListAppendVariables(interp, &zElem, &nElem); |
| 944 | if( rc!=TH_OK ){ |
| 945 | return rc; |
| 946 | } |
| 947 | Th_SetResult(interp, zElem, nElem); |
| 948 | return TH_OK; |
| 949 | } |
| 950 | |
| 951 | /* |
| 952 | ** TH Syntax: |
| 953 |
| --- src/th_lang.c | |
| +++ src/th_lang.c | |
| @@ -920,10 +920,11 @@ | |
| 920 | rc = Th_ListAppendCommands(interp, &zElem, &nElem); |
| 921 | if( rc!=TH_OK ){ |
| 922 | return rc; |
| 923 | } |
| 924 | Th_SetResult(interp, zElem, nElem); |
| 925 | if( zElem ) Th_Free(interp, zElem); |
| 926 | return TH_OK; |
| 927 | } |
| 928 | |
| 929 | /* |
| 930 | ** TH Syntax: |
| @@ -943,10 +944,11 @@ | |
| 944 | rc = Th_ListAppendVariables(interp, &zElem, &nElem); |
| 945 | if( rc!=TH_OK ){ |
| 946 | return rc; |
| 947 | } |
| 948 | Th_SetResult(interp, zElem, nElem); |
| 949 | if( zElem ) Th_Free(interp, zElem); |
| 950 | return TH_OK; |
| 951 | } |
| 952 | |
| 953 | /* |
| 954 | ** TH Syntax: |
| 955 |