rtmp: Clean up properly if the handshake failed
authorMartin Storsjö <martin@martin.st>
Thu, 1 Dec 2011 09:34:06 +0000 (11:34 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 1 Dec 2011 11:47:25 +0000 (13:47 +0200)
This prevents memory leaks if this function returns an error.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtmpproto.c

index 37c3d95..979c5b6 100644 (file)
@@ -826,7 +826,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
 
     rt->state = STATE_START;
     if (rtmp_handshake(s, rt))
-        return -1;
+        goto fail;
 
     rt->chunk_size = 128;
     rt->state = STATE_HANDSHAKED;