changeset 4591:e62a61d3e591 libavformat

fix a memleak in av_metadata_set()
author aurel
date Thu, 26 Feb 2009 14:40:04 +0000
parents 85c7d517d556
children 3cd44adef5e8
files metadata.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/metadata.c	Thu Feb 26 14:24:50 2009 +0000
+++ b/metadata.c	Thu Feb 26 14:40:04 2009 +0000
@@ -68,8 +68,10 @@
         m->elems[m->count].value= av_strdup(value);
         m->count++;
     }
-    if(!m->count)
+    if(!m->count) {
+        av_free(m->elems);
         av_freep(pm);
+    }
 
     return 0;
 }