From 495d0c0eabc5648186e7d58ad54b508d14af38f4 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Thu, 24 Oct 2013 17:55:12 -0400 Subject: [PATCH] Check for NULL before freeing th_pathname Thanks to Harald Koch for pointing out that AIX 4 and 5 still need this. --- lib/handle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.11.4.GIT