fix memleak on tar_open() failure
authorHuzaifa Sidhpurwala <huzaifas@fedoraproject.org>
Wed, 16 Oct 2013 00:02:58 +0000 (15 20:02 -0400)
committerChris Frey <cdfrey@foursquare.net>
Wed, 16 Oct 2013 00:02:58 +0000 (15 20:02 -0400)
lib/handle.c

index 33a262c..002d23c 100644 (file)
@@ -82,6 +82,7 @@ tar_open(TAR **t, const char *pathname, tartype_t *type,
        (*t)->fd = (*((*t)->type->openfunc))(pathname, oflags, mode);
        if ((*t)->fd == -1)
        {
+               libtar_hash_free((*t)->h, NULL);
                free(*t);
                return -1;
        }