diff options
| author | rtr <rtr@NetBSD.org> | 2006-03-18 12:35:41 +0000 |
|---|---|---|
| committer | rtr <rtr@NetBSD.org> | 2006-03-18 12:35:41 +0000 |
| commit | b06fd00a811afe073aa438f9fa6fce22478e007d (patch) | |
| tree | b3fe71de1866229969a634f9432bb2d2ff338434 /usr.sbin/makefs | |
| parent | 1c8b9fae531fdaddaa2116c76da178d454f61ddc (diff) | |
free buf on error path
coverity 190 / run 5
Diffstat (limited to 'usr.sbin/makefs')
| -rw-r--r-- | usr.sbin/makefs/ffs.c | 6 |
1 files 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 <sys/cdefs.h> #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 <sys/param.h> @@ -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) |
