summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/krb5/addr_families.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-03-22 10:16:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:59:02 -0500
commit864d9b531dc2fba94f5ea839b087e28d402c643a (patch)
tree91f72ed27956be3c0d536d725b0505cba35e3adb /source4/heimdal/lib/krb5/addr_families.c
parent4fd82be1403f873f67eecb8fee457b8de9fc5cd1 (diff)
downloadsamba-864d9b531dc2fba94f5ea839b087e28d402c643a.tar.gz
samba-864d9b531dc2fba94f5ea839b087e28d402c643a.tar.bz2
samba-864d9b531dc2fba94f5ea839b087e28d402c643a.zip
r14635: - Remove lex.c from SVN (it is built anyway, and having it in SVN
confuses things) - Update Samba4 from lorikeet-heimdal - Remove generated symlink on make clean Andrew Bartlett (This used to be commit a5c2b4cc92e807d18cb8df99bebf004fa4252e1e)
Diffstat (limited to 'source4/heimdal/lib/krb5/addr_families.c')
-rw-r--r--source4/heimdal/lib/krb5/addr_families.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source4/heimdal/lib/krb5/addr_families.c b/source4/heimdal/lib/krb5/addr_families.c
index ccc97f412d..cf460ba725 100644
--- a/source4/heimdal/lib/krb5/addr_families.c
+++ b/source4/heimdal/lib/krb5/addr_families.c
@@ -33,7 +33,7 @@
#include "krb5_locl.h"
-RCSID("$Id: addr_families.c,v 1.49 2005/06/16 20:16:12 lha Exp $");
+RCSID("$Id: addr_families.c,v 1.50 2006/03/17 22:12:13 lha Exp $");
struct addr_operations {
int af;
@@ -930,11 +930,18 @@ krb5_parse_address(krb5_context context,
int error;
int save_errno;
+ addresses->len = 0;
+ addresses->val = NULL;
+
for(i = 0; i < num_addrs; i++) {
if(at[i].parse_addr) {
krb5_address addr;
if((*at[i].parse_addr)(context, string, &addr) == 0) {
ALLOC_SEQ(addresses, 1);
+ if (addresses->val == NULL) {
+ krb5_set_error_string(context, "malloc: out of memory");
+ return ENOMEM;
+ }
addresses->val[0] = addr;
return 0;
}
@@ -1047,6 +1054,8 @@ krb5_free_addresses(krb5_context context,
for(i = 0; i < addresses->len; i++)
krb5_free_address(context, &addresses->val[i]);
free(addresses->val);
+ addresses->len = 0;
+ addresses->val = NULL;
return 0;
}