Coverity: Resource leak: CID 400020
authorNelson Ferreira <nelson.ferreira@ieee.org>
Wed, 29 Feb 2012 21:11:08 +0000 (16:11 -0500)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Wed, 29 Feb 2012 21:11:08 +0000 (16:11 -0500)
* src/editfns.c (Ftemp_directory): Check against 0 too. Unlikely
but possible.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/editfns.c

index 089b7f4..0faac7b 100644 (file)
@@ -630,7 +630,7 @@ On Unix it is obtained from TMPDIR, with /tmp as the default.
                                        /* we already are reserved these 20 bytes... */
                                        strcat(warnpath, ".created_by_sxemacs");
                                        if ((fd = open(warnpath, O_WRONLY | O_CREAT,
-                                                      0644)) > 0) {
+                                                      0644)) >= 0) {
                                                write(fd, "SXEmacs created this directory "
                                                          "because /tmp/<yourname> "
                                                          "was unavailable -- \nPlease check !\n",  89);