diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libads/cldap.c | 7 | ||||
-rw-r--r-- | source3/libads/ldap.c | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/source3/libads/cldap.c b/source3/libads/cldap.c index f67372805f..2e96270e90 100644 --- a/source3/libads/cldap.c +++ b/source3/libads/cldap.c @@ -191,6 +191,11 @@ static int recv_cldap_netlogon(int sock, struct cldap_netlogon_reply *reply) char *p; blob = data_blob(NULL, 8192); + if (blob.data == NULL) { + DEBUG(1, ("data_blob failed\n")); + errno = ENOMEM; + return -1; + } /* Setup timeout */ gotalarm = 0; @@ -206,6 +211,7 @@ static int recv_cldap_netlogon(int sock, struct cldap_netlogon_reply *reply) if (ret <= 0) { DEBUG(1,("no reply received to cldap netlogon\n")); + data_blob_free(&blob); return -1; } blob.length = ret; @@ -227,6 +233,7 @@ static int recv_cldap_netlogon(int sock, struct cldap_netlogon_reply *reply) asn1_end_tag(&data); if (data.has_error) { + data_blob_free(&blob); asn1_free(&data); DEBUG(1,("Failed to parse cldap reply\n")); return -1; diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index a8ee770582..5d972b35fc 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -134,6 +134,7 @@ BOOL ads_try_connect(ADS_STRUCT *ads, const char *server ) if ( !ads_cldap_netlogon( srv, ads->server.realm, &cldap_reply ) ) { DEBUG(3,("ads_try_connect: CLDAP request %s failed.\n", srv)); + SAFE_FREE( srv ); return False; } |