diff options
author | joerg <joerg@pkgsrc.org> | 2009-03-09 20:01:22 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2009-03-09 20:01:22 +0000 |
commit | 8de13e20ef7e77f100052ccd94584b1b761d74f6 (patch) | |
tree | 67afaaca1fe923fc6f3360d991ba5c1af9766af3 /pkgtools | |
parent | 4b68a2dafa2266dcea7083fe9bb44ba735446ce5 (diff) | |
download | pkgsrc-8de13e20ef7e77f100052ccd94584b1b761d74f6.tar.gz |
Use archive_read_finish and avoid double-free if the archive couldn't be
opened.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkg_install/files/lib/pkg_io.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pkgtools/pkg_install/files/lib/pkg_io.c b/pkgtools/pkg_install/files/lib/pkg_io.c index 85a12dc7f08..74966dd445b 100644 --- a/pkgtools/pkg_install/files/lib/pkg_io.c +++ b/pkgtools/pkg_install/files/lib/pkg_io.c @@ -1,4 +1,4 @@ -/* $NetBSD: pkg_io.c,v 1.6 2009/03/08 14:50:37 joerg Exp $ */ +/* $NetBSD: pkg_io.c,v 1.7 2009/03/09 20:01:22 joerg Exp $ */ /*- * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org>. * All rights reserved. @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: pkg_io.c,v 1.6 2009/03/08 14:50:37 joerg Exp $"); +__RCSID("$NetBSD: pkg_io.c,v 1.7 2009/03/09 20:01:22 joerg Exp $"); #include <archive.h> #include <archive_entry.h> @@ -111,8 +111,7 @@ open_archive_by_url(struct url *url) archive_read_support_format_all(a); if (archive_read_open(a, f, fetch_archive_open, fetch_archive_read, fetch_archive_close)) { - archive_read_close(a); - free(f); + archive_read_finish(a); return NULL; } |