From f0de01856fde4a104254569f9d5c80a80cac49cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= <Reimar.Doeffinger@gmx.de>
Date: Tue, 29 Jul 2014 21:23:14 +0200
Subject: [PATCH] dict.c: minor simplification.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
---
 libavutil/dict.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavutil/dict.c b/libavutil/dict.c
index 358958cdc5e..aea89105412 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -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)
-- 
GitLab