summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dive.c b/dive.c
index 1b4c78306..da80044ed 100644
--- a/dive.c
+++ b/dive.c
@@ -908,11 +908,11 @@ static char *merge_text(const char *a, const char *b)
if (!a && !b)
return NULL;
if (!a || !*a)
- return strdup(b);
+ return b ? strdup(b) : NULL;
if (!b || !*b)
return strdup(a);
if (!strcmp(a,b))
- return strdup(a);
+ return a ? strdup(a) : NULL;
res = malloc(strlen(a) + strlen(b) + 32);
if (!res)
return (char *)a;