Browse code

tiff: fix leak on error return in doubles2str()

Fixes CID733797
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2012/10/11 23:51:08
Showing 1 changed files
... ...
@@ -216,8 +216,10 @@ static char *doubles2str(double *dp, int count, const char *sep)
216 216
     ap[0] = '\0';
217 217
     for (i = 0; i < count; i++) {
218 218
         unsigned l = snprintf(ap, component_len, "%f%s", dp[i], sep);
219
-        if(l >= component_len)
219
+        if(l >= component_len) {
220
+            av_free(ap0);
220 221
             return NULL;
222
+        }
221 223
         ap += l;
222 224
     }
223 225
     ap0[strlen(ap0) - strlen(sep)] = '\0';