diff options
-rw-r--r-- | usr.sbin/dhcpd/memory.c | 6 |
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); |