On Thu, 12 Apr 2012, Samuel Pitoiset wrote:

@@ -847,6 +852,19 @@ static int rtmp_open(URLContext *s, const char *uri, int 
flags)

    rt->chunk_size = 128;
    rt->state = STATE_HANDSHAKED;
+
+    // Keep the application name when it has been defined by the user.
+    if (rt->app) {
+        old_app = av_strdup(rt->app);
+        av_free(rt->app);
+    }

Ok, almost there. This won't leak - but, if rt->app is allocated by av_malloc/av_strdup, and we want old_app to be allocated by that too, why copy and free the old one, why not just do old_app = rt->app;? That will do exactly what you need...

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to