about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2018-11-02 02:57:43 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2018-11-02 02:57:43 +0000
commitb6eceb660067e66762977268fad6a38749dcf193 (patch)
treee1b912f747fec1561e69ca998b4b7e26cfa16752 /lib
parentc34adb82dc8d0ec0d5a66e9a5af2db18ea825c1b (diff)
downloadnetpbm-mirror-b6eceb660067e66762977268fad6a38749dcf193.tar.gz
netpbm-mirror-b6eceb660067e66762977268fad6a38749dcf193.tar.xz
netpbm-mirror-b6eceb660067e66762977268fad6a38749dcf193.zip
Release 10.73.22
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@3413 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib')
-rw-r--r--lib/colorname.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/colorname.c b/lib/colorname.c
index 123de75e..83cf5d1a 100644
--- a/lib/colorname.c
+++ b/lib/colorname.c
@@ -199,7 +199,12 @@ pm_parse_dictionary_name(char    const colorname[],
     pixval r,g,b;
 
     f = pm_openColornameFile(NULL, TRUE);  /* exits if error */
-    canoncolor = strdup(colorname);
+    canoncolor = pm_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;