diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-09-14 03:42:28 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-09-14 03:42:28 +0800 |
commit | 02fecf70e20ceead39137a61916d1d5e479853b2 (patch) | |
tree | fd753561771d30e206307de5b415ce2382d991b3 /e-util | |
parent | b280d814d60baee0a3fb9f6885f1a0c4b9553606 (diff) | |
download | gsoc2013-evolution-02fecf70e20ceead39137a61916d1d5e479853b2.tar.gz gsoc2013-evolution-02fecf70e20ceead39137a61916d1d5e479853b2.tar.zst gsoc2013-evolution-02fecf70e20ceead39137a61916d1d5e479853b2.zip |
Make sure the dir pointer is non-NULL before using it.
2001-09-13 Jeffrey Stedfast <fejj@ximian.com>
* e-mktemp.c (e_mktemp_cleanup): Make sure the dir pointer is
non-NULL before using it.
svn path=/trunk/; revision=12807
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 5 | ||||
-rw-r--r-- | e-util/e-mktemp.c | 18 |
2 files changed, 15 insertions, 8 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index bb0ebf0a21..056ae07197 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,8 @@ +2001-09-13 Jeffrey Stedfast <fejj@ximian.com> + + * e-mktemp.c (e_mktemp_cleanup): Make sure the dir pointer is + non-NULL before using it. + 2001-09-08 Dan Winship <danw@ximian.com> * e-html-utils.c (e_text_to_html_full): Fix some broken calls to diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c index e532498c1d..1d878b1ba0 100644 --- a/e-util/e-mktemp.c +++ b/e-util/e-mktemp.c @@ -127,15 +127,17 @@ e_mktemp_cleanup (void) /* first empty out this directory of it's files... */ dir = opendir (node->data); - while ((dent = readdir (dir)) != NULL) { - /* yea...so if we contain - subdirectories this won't work, but - it shouldn't so we won't - bother caring... */ - if (strcmp (dent->d_name, ".") && strcmp (dent->d_name, "..")) - unlink (dent->d_name); + if (dir) { + while ((dent = readdir (dir)) != NULL) { + /* yea...so if we contain + subdirectories this won't work, but + it shouldn't so we won't + bother caring... */ + if (strcmp (dent->d_name, ".") && strcmp (dent->d_name, "..")) + unlink (dent->d_name); + } + closedir (dir); } - closedir (dir); /* ...then rmdir the directory */ rmdir (node->data); |