summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-12-10 01:22:10 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-12-10 01:22:10 +0000
commit7b033ba58fb41abb23b374c7fff7ea6b0b5bc000 (patch)
treed9f8670ca06f276676c03703ac50b086f9752fa4 /usr.sbin
parent3951502e815e471b026e326ba14ce3c1b13a0372 (diff)
plug memory leak, spotted by parfait; ok krw
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/dhcpd/memory.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/dhcpd/memory.c b/usr.sbin/dhcpd/memory.c
index 84714112e7a..e30d0bf826f 100644
--- a/usr.sbin/dhcpd/memory.c
+++ b/usr.sbin/dhcpd/memory.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memory.c,v 1.15 2008/05/07 12:19:20 beck Exp $ */
+/* $OpenBSD: memory.c,v 1.16 2009/12/10 01:22:09 deraadt Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium.
@@ -802,8 +802,10 @@ add_class(int type, char *name)
if (!user_class_hash)
user_class_hash = new_hash();
- if (!tname || !class || !vendor_class_hash || !user_class_hash)
+ if (!tname || !class || !vendor_class_hash || !user_class_hash) {
+ free(tname);
return NULL;
+ }
memset(class, 0, sizeof *class);
strlcpy(tname, name, strlen(name) + 1);