avcodec/avpacket: Use av_free_packet() in error cleanups
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 30 Aug 2013 18:57:55 +0000 (20:57 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 30 Aug 2013 19:43:35 +0000 (21:43 +0200)
This prevents memleaks on errors
reproduceable with fate when error pathes are forced

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/avpacket.c

index 7196c31..b6b4109 100644 (file)
@@ -215,7 +215,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
     return 0;
 
 failed_alloc:
-    av_destruct_packet(pkt);
+    av_free_packet(pkt);
     return AVERROR(ENOMEM);
 }
 
@@ -237,7 +237,7 @@ int av_copy_packet_side_data(AVPacket *pkt, AVPacket *src)
     return 0;
 
 failed_alloc:
-    av_destruct_packet(pkt);
+    av_free_packet(pkt);
     return AVERROR(ENOMEM);
 }