summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authormiko <miko@cvs.openbsd.org>2018-11-07 04:51:57 +0000
committermiko <miko@cvs.openbsd.org>2018-11-07 04:51:57 +0000
commit78dca2a7545d0ae10ce82e01c48aa8922e9754b3 (patch)
tree2789240939601b658c05cee7559ba8d2389979d9 /usr.sbin
parentfe3c5a21fe9b31e50b1be12a0641448fe19283bc (diff)
avoid freeing r twice in error case; OK otto@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/installboot/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/installboot/util.c b/usr.sbin/installboot/util.c
index c62d145b875..305362f3a1c 100644
--- a/usr.sbin/installboot/util.c
+++ b/usr.sbin/installboot/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.12 2018/07/03 20:14:41 jcs Exp $ */
+/* $OpenBSD: util.c,v 1.13 2018/11/07 04:51:56 miko Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
@@ -124,11 +124,11 @@ fileprefix(const char *base, const char *path)
goto err;
}
n = snprintf(s, PATH_MAX, "%s/%s", r, b);
- free(r);
if (n < 1 || n >= PATH_MAX) {
warn("snprintf");
goto err;
}
+ free(r);
return (s);
err: