From 6352c6bb63244f59072ea1fc1f6be0631c0cdd8c Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Thu, 26 Feb 2009 14:40:04 +0000 Subject: [PATCH] fix a memleak in av_metadata_set() Originally committed as revision 17617 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/metadata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }