about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--intl/dcigettext.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index 75f17072a2..3c86b83f28 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -607,7 +607,8 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
 		      /* Insert the entry in the search tree.  */
 		      foundp = (struct known_translation_t **)
 			tsearch (newp, &root, transcmp);
-		      if (__builtin_expect (&newp != foundp, 0))
+		      if (foundp == NULL
+			  || __builtin_expect (*foundp != newp, 0))
 			/* The insert failed.  */
 			free (newp);
 		    }