From: David Lawrence Ramsey Date: Tue, 11 Jul 2006 18:17:56 +0000 (+0000) Subject: in do_browse_from(), don't bother freeing path if it's NULL X-Git-Tag: v1.9.99pre1~84 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b8592ce2bb9e3380994e765d8add6df3148fff10;p=nano.git in do_browse_from(), don't bother freeing path if it's NULL git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3777 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 4531107b..8a32343f 100644 --- 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) diff --git a/src/browser.c b/src/browser.c index f48e8c24..c2199ee6 100644 --- a/src/browser.c +++ b/src/browser.c @@ -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; }