Module Name:    src
Committed By:   christos
Date:           Wed Apr 13 01:41:18 UTC 2016

Modified Files:
        src/usr.sbin/makemandb: makemandb.c

Log Message:
PR/51040: Abhinav Upadhyay: Fix memory leak


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/makemandb/makemandb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makemandb/makemandb.c
diff -u src/usr.sbin/makemandb/makemandb.c:1.35 src/usr.sbin/makemandb/makemandb.c:1.36
--- src/usr.sbin/makemandb/makemandb.c:1.35	Tue Apr 12 21:40:09 2016
+++ src/usr.sbin/makemandb/makemandb.c	Tue Apr 12 21:41:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemandb.c,v 1.35 2016/04/13 01:40:09 christos Exp $	*/
+/*	$NetBSD: makemandb.c,v 1.36 2016/04/13 01:41:18 christos Exp $	*/
 /*
  * Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadh...@gmail.com>
  * Copyright (c) 2011 Kristaps Dzonsons <krist...@bsd.lv>
@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: makemandb.c,v 1.35 2016/04/13 01:40:09 christos Exp $");
+__RCSID("$NetBSD: makemandb.c,v 1.36 2016/04/13 01:41:18 christos Exp $");
 
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -703,7 +703,7 @@ read_and_decompress(const char *file, vo
 	for (;;) {
 		r = archive_read_data(a, buf + off, *len - off);
 		if (r == ARCHIVE_OK) {
-			archive_read_close(a);
+			archive_read_finish(a);
 			*bufp = buf;
 			*len = off;
 			return 0;
@@ -719,7 +719,7 @@ read_and_decompress(const char *file, vo
 				if (mflags.verbosity)
 					warnx("File too large: %s", file);
 				free(buf);
-				archive_read_close(a);
+				archive_read_finish(a);
 				return -1;
 			}
 			buf = erealloc(buf, *len);
@@ -728,7 +728,7 @@ read_and_decompress(const char *file, vo
 
 archive_error:
 	warnx("Error while reading `%s': %s", file, archive_error_string(a));
-	archive_read_close(a);
+	archive_read_finish(a);
 	return -1;
 }
 

Reply via email to