]> git.wh0rd.org Git - nano.git/commitdiff
in do_browse_from(), don't bother freeing path if it's NULL
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 11 Jul 2006 18:17:56 +0000 (18:17 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 11 Jul 2006 18:17:56 +0000 (18:17 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3777 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/browser.c

index 4531107b77985cb808cc529d96bf670f49b16607..8a32343f140987701cb96212445de7dca9c3f9b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@ CVS code -
        - During the operating directory check, if path isn't NULL,
          don't bother freeing it before mallocstrcpy()ing operating_dir
          into it, as the latter operation will free it. (DLR)
+       - Don't bother freeing path if it's NULL. (DLR)
   browser_init()
        - Fix off-by-one error when calculating longest that kept the
          rightmost column of the screen from being used. (DLR)
index f48e8c2472f922f119ce40c571ff47ab0e7d17fb..c2199ee6bab806a64e767815a88f4a6b3c0a6c69 100644 (file)
@@ -426,7 +426,8 @@ char *do_browse_from(const char *inpath)
 
     /* If we can't open the path, get out. */
     if (dir == NULL) {
-       free(path);
+       if (path != NULL)
+           free(path);
        beep();
        return NULL;
     }