Mercurial > libavformat.hg
comparison metadata.c @ 4591:e62a61d3e591 libavformat
fix a memleak in av_metadata_set()
author | aurel |
---|---|
date | Thu, 26 Feb 2009 14:40:04 +0000 |
parents | e4a1b568b313 |
children | f04bc8b70940 |
comparison
equal
deleted
inserted
replaced
4590:85c7d517d556 | 4591:e62a61d3e591 |
---|---|
66 if(value){ | 66 if(value){ |
67 m->elems[m->count].key = av_strdup(key ); | 67 m->elems[m->count].key = av_strdup(key ); |
68 m->elems[m->count].value= av_strdup(value); | 68 m->elems[m->count].value= av_strdup(value); |
69 m->count++; | 69 m->count++; |
70 } | 70 } |
71 if(!m->count) | 71 if(!m->count) { |
72 av_free(m->elems); | |
72 av_freep(pm); | 73 av_freep(pm); |
74 } | |
73 | 75 |
74 return 0; | 76 return 0; |
75 } | 77 } |
76 | 78 |
77 void av_metadata_free(AVMetadata **pm) | 79 void av_metadata_free(AVMetadata **pm) |