about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-02-13 03:16:50 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-02-13 03:16:50 +0000
commit7f1e4ea14d706c0821969fda88e028352dac2189 (patch)
tree5d7c5f4c755b0874d55ae5823e10399c6bb02eaa
parent7499e77a7fc64232ec997718aa1605cfe9fb4134 (diff)
downloadnetpbm-mirror-7f1e4ea14d706c0821969fda88e028352dac2189.tar.gz
netpbm-mirror-7f1e4ea14d706c0821969fda88e028352dac2189.tar.xz
netpbm-mirror-7f1e4ea14d706c0821969fda88e028352dac2189.zip
pm_make_tmpfile_fd: fix improper handling when unable to get memory to construct file name
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1651 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--doc/HISTORY4
-rw-r--r--lib/pmfileio.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 1bd37e7f..f2b4d41d 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -14,6 +14,10 @@ not yet  BJH  Release 10.58.00
 
               xpmtoppm: Make it work on XPM with zero characters per pixel.
 
+
+              pm_make_tmpfile_fd: fix improper handling when unable to get
+              memory to construct file name.
+
               Windows/Mingw: fix bug: temporary file creation fails
               consistently.  Broken in 10.34.
 
diff --git a/lib/pmfileio.c b/lib/pmfileio.c
index 1d7d2643..ab1fcd32 100644
--- a/lib/pmfileio.c
+++ b/lib/pmfileio.c
@@ -265,7 +265,7 @@ pm_make_tmpfile_fd(int *         const fdP,
     pm_asprintf(&filenameTemplate, "%s%s%s%s", 
                 tmpdir, dirseparator, pm_progname, "_XXXXXX");
 
-    if (filenameTemplate == NULL)
+    if (filenameTemplate == pm_strsol)
         pm_asprintf(&error,
                     "Unable to allocate storage for temporary file name");
     else {