Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-27 17:48:32 +0300
committerMichael Niedermayer <michaelni@gmx.at>2014-12-27 17:48:32 +0300
commit336bb3f706ea86239f2bb1cadff3a7c40f95d130 (patch)
tree39a6d5c1fd76a385a1b3219cb8deac0dba27cf49 /libavutil/dict.c
parent9e893473297ed5c60d40a19eb17a85dca2e63ab3 (diff)
avutil/dict: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/dict.c')
-rw-r--r--libavutil/dict.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavutil/dict.c b/libavutil/dict.c
index a362de07d7..0d54c7970a 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -120,7 +120,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
m->count++;
}
if (!m->count) {
- av_free(m->elems);
+ av_freep(&m->elems);
av_freep(pm);
}
@@ -128,7 +128,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
err_out:
if (m && !m->count) {
- av_free(m->elems);
+ av_freep(&m->elems);
av_freep(pm);
}
if (flags & AV_DICT_DONT_STRDUP_KEY) av_free((void*)key);
@@ -197,10 +197,10 @@ void av_dict_free(AVDictionary **pm)
if (m) {
while (m->count--) {
- av_free(m->elems[m->count].key);
- av_free(m->elems[m->count].value);
+ av_freep(&m->elems[m->count].key);
+ av_freep(&m->elems[m->count].value);
}
- av_free(m->elems);
+ av_freep(&m->elems);
}
av_freep(pm);
}