smoothstreamingenc: Fix a memory leak on errors
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Jul 2014 03:02:38 +0000 (05:02 +0200)
committerMartin Storsjö <martin@martin.st>
Mon, 7 Jul 2014 19:08:42 +0000 (22:08 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/smoothstreamingenc.c

index 9fe4fe5..457472d 100644 (file)
@@ -155,9 +155,10 @@ static void get_private_data(OutputStream *os)
         return;
     os->private_str = av_mallocz(2*size + 1);
     if (!os->private_str)
-        return;
+        goto fail;
     for (i = 0; i < size; i++)
         snprintf(&os->private_str[2*i], 3, "%02x", ptr[i]);
+fail:
     if (ptr != codec->extradata)
         av_free(ptr);
 }