summaryrefslogtreecommitdiff
path: root/kerberosIV/kerberos
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1998-08-16 02:42:12 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1998-08-16 02:42:12 +0000
commit364a0613877e4712a7614d08e62ec043adfbf94b (patch)
tree6d958783b2dd21a5d023a0db66ec592659ae63ad /kerberosIV/kerberos
parent7f6450fdf2329ea9c097d81109b3f08742bf8a4d (diff)
realloc fixes
Diffstat (limited to 'kerberosIV/kerberos')
-rw-r--r--kerberosIV/kerberos/kerberos.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kerberosIV/kerberos/kerberos.c b/kerberosIV/kerberos/kerberos.c
index 0138f9bad86..11d85f7407e 100644
--- a/kerberosIV/kerberos/kerberos.c
+++ b/kerberosIV/kerberos/kerberos.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kerberos.c,v 1.13 1998/07/13 19:57:19 art Exp $ */
+/* $OpenBSD: kerberos.c,v 1.14 1998/08/16 02:42:11 art Exp $ */
/* $KTH: kerberos.c,v 1.70 1997/09/26 18:06:38 joda Exp $ */
/*
@@ -575,8 +575,10 @@ add_port(struct port_spec **ports, int *num_ports, int port, int type)
{
struct port_spec *tmp;
tmp = realloc(*ports, (*num_ports + 1) * sizeof(*tmp));
- if(tmp == NULL)
+ if(tmp == NULL) {
+ free(*ports);
return ENOMEM;
+ }
*ports = tmp;
tmp[*num_ports].port = port;
tmp[*num_ports].type = type;