diff options
author | joerg <joerg> | 2009-03-09 20:01:22 +0000 |
---|---|---|
committer | joerg <joerg> | 2009-03-09 20:01:22 +0000 |
commit | e73c656c5b23692b55b65230dd42e1fc0cb5f738 (patch) | |
tree | 67afaaca1fe923fc6f3360d991ba5c1af9766af3 /pkgtools | |
parent | 9236836eba5274a9c41fa13f7d5c7f36b968c755 (diff) | |
download | pkgsrc-e73c656c5b23692b55b65230dd42e1fc0cb5f738.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; } |