dict.c: minor simplification.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Tue, 29 Jul 2014 19:23:14 +0000 (21:23 +0200)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Thu, 31 Jul 2014 18:10:29 +0000 (20:10 +0200)
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
libavutil/dict.c

index 358958c..aea8910 100644 (file)
@@ -90,10 +90,9 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
     } else {
         AVDictionaryEntry *tmp = av_realloc(m->elems,
                                             (m->count + 1) * sizeof(*m->elems));
-        if (tmp)
-            m->elems = tmp;
-        else
+        if (!tmp)
             return AVERROR(ENOMEM);
+        m->elems = tmp;
     }
     if (value) {
         if (flags & AV_DICT_DONT_STRDUP_KEY)