doc/examples/http_multiclient: Fix resource leak
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 26 Dec 2016 16:41:38 +0000 (17:41 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 26 Dec 2016 17:29:00 +0000 (18:29 +0100)
Fixes CID1396269

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
doc/examples/http_multiclient.c

index 7173c4d..e2c2201 100644 (file)
@@ -45,6 +45,7 @@ static void process_client(AVIOContext *client, const char *in_uri)
         // may return empty string.
         if (resource && strlen(resource))
             break;
+        av_freep(&resource);
     }
     if (ret < 0)
         goto end;
@@ -93,6 +94,7 @@ end:
     avio_close(client);
     fprintf(stderr, "Closing input\n");
     avio_close(input);
+    av_freep(&resource);
 }
 
 int main(int argc, char **argv)