about summary refs log tree commit diff
path: root/lib/colorname.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/colorname.c')
-rw-r--r--lib/colorname.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/colorname.c b/lib/colorname.c
index 596d8788..c4d34fc2 100644
--- a/lib/colorname.c
+++ b/lib/colorname.c
@@ -200,6 +200,11 @@ pm_parse_dictionary_namen(char   const colorname[],
 
     fP = pm_openColornameFile(NULL, TRUE);  /* exits if error */
     canoncolor = strdup(colorname);
+
+    if (!canoncolor)
+        pm_error("Failed to allocate memory for %u-byte color name",
+                 (unsigned)strlen(colorname));
+
     pm_canonstr(canoncolor);
     gotit = FALSE;
     colorfileExhausted = FALSE;