Merge lorikeet-heimdal -r 787 into Samba4 tree.
[samba.git] / source4 / heimdal / lib / krb5 / auth_context.c
index 5e08f15ad46102957b810ae7cc363f636f90f256..323f17a24534edd229ebdc6e1577bc166ef1dfb8 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "krb5_locl.h"
 
-RCSID("$Id: auth_context.c 14452 2005-01-05 02:34:08Z lukeh $");
+RCSID("$Id: auth_context.c 21745 2007-07-31 16:11:25Z lha $");
 
 krb5_error_code KRB5_LIB_FUNCTION
 krb5_auth_con_init(krb5_context context,
@@ -141,14 +141,16 @@ krb5_auth_con_setaddrs(krb5_context context,
        if (auth_context->local_address)
            krb5_free_address (context, auth_context->local_address);
        else
-           auth_context->local_address = malloc(sizeof(krb5_address));
+           if ((auth_context->local_address = malloc(sizeof(krb5_address))) == NULL)
+               return ENOMEM;
        krb5_copy_address(context, local_addr, auth_context->local_address);
     }
     if (remote_addr) {
        if (auth_context->remote_address)
            krb5_free_address (context, auth_context->remote_address);
        else
-           auth_context->remote_address = malloc(sizeof(krb5_address));
+           if ((auth_context->remote_address = malloc(sizeof(krb5_address))) == NULL)
+               return ENOMEM;
        krb5_copy_address(context, remote_addr, auth_context->remote_address);
     }
     return 0;