summaryrefslogtreecommitdiff
path: root/libavformat/metadata.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2009-02-26 14:40:04 +0000
committerAurelien Jacobs <aurel@gnuage.org>2009-02-26 14:40:04 +0000
commit6352c6bb63244f59072ea1fc1f6be0631c0cdd8c (patch)
tree67ce6b25c69b0e1164901349e4b359da78ef5f10 /libavformat/metadata.c
parent144ae29ddef24d31fd0f113a33dd33f4b67046c4 (diff)
downloadffmpeg-6352c6bb63244f59072ea1fc1f6be0631c0cdd8c.tar.gz
fix a memleak in av_metadata_set()
Originally committed as revision 17617 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/metadata.c')
-rw-r--r--libavformat/metadata.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/metadata.c b/libavformat/metadata.c
index 6744f22db7..1a2a907d98 100644
--- a/libavformat/metadata.c
+++ b/libavformat/metadata.c
@@ -68,8 +68,10 @@ int av_metadata_set(AVMetadata **pm, const char *key, const char *value)
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;
}