From: Chris Frey Date: Thu, 24 Oct 2013 21:55:12 +0000 (-0400) Subject: Check for NULL before freeing th_pathname X-Git-Url: https://repo.or.cz/w/libtar.git/commitdiff_plain/495d0c0eabc5648186e7d58ad54b508d14af38f4 Check for NULL before freeing th_pathname Thanks to Harald Koch for pointing out that AIX 4 and 5 still need this. --- diff --git a/lib/handle.c b/lib/handle.c index a19c046..28a7dc2 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -122,7 +122,8 @@ tar_close(TAR *t) libtar_hash_free(t->h, ((t->oflags & O_ACCMODE) == O_RDONLY ? free : (libtar_freefunc_t)tar_dev_free)); - free(t->th_pathname); + if (t->th_pathname != NULL) + free(t->th_pathname); free(t); return i;