From b06fd00a811afe073aa438f9fa6fce22478e007d Mon Sep 17 00:00:00 2001 From: rtr Date: Sat, 18 Mar 2006 12:35:41 +0000 Subject: free buf on error path coverity 190 / run 5 --- usr.sbin/makefs/ffs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c index ffa7bef7254..a32965020df 100644 --- a/usr.sbin/makefs/ffs.c +++ b/usr.sbin/makefs/ffs.c @@ -1,4 +1,4 @@ -/* $NetBSD: ffs.c,v 1.37 2005/10/23 16:12:02 thorpej Exp $ */ +/* $NetBSD: ffs.c,v 1.38 2006/03/18 12:35:41 rtr Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -71,7 +71,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: ffs.c,v 1.37 2005/10/23 16:12:02 thorpej Exp $"); +__RCSID("$NetBSD: ffs.c,v 1.38 2006/03/18 12:35:41 rtr Exp $"); #endif /* !__lint */ #include @@ -509,10 +509,12 @@ ffs_create_image(const char *image, fsinfo_t *fsopts) if (i == -1) { warn("zeroing image, %lld bytes to go", (long long)bufrem); + free(buf); return (-1); } bufrem -= i; } + free(buf); /* make the file system */ if (debug & DEBUG_FS_CREATE_IMAGE) -- cgit