winbindd: Add a missing NULL check
authorVolker Lendecke <vl@samba.org>
Sat, 19 May 2018 16:39:36 +0000 (18:39 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 15 Jun 2018 23:06:36 +0000 (01:06 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/winbindd/winbindd_ping_dc.c

index 374781902fd50b128b332d375a5031e811f27790..8000493db45da846bd5e253542c57787c4c7457b 100644 (file)
@@ -129,6 +129,9 @@ NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
 
        if (state->dcname) {
                presp->extra_data.data = talloc_strdup(presp, state->dcname);
+               if (presp->extra_data.data == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+               }
                presp->length += strlen((char *)presp->extra_data.data) + 1;
        }