fix a memleak in av_metadata_set()

Originally committed as revision 17617 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Aurelien Jacobs 2009-02-26 14:40:04 +00:00
parent 144ae29dde
commit 6352c6bb63

View File

@ -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->elems[m->count].value= av_strdup(value);
m->count++; m->count++;
} }
if(!m->count) if(!m->count) {
av_free(m->elems);
av_freep(pm); av_freep(pm);
}
return 0; return 0;
} }