libwbclient: CID 2199 -- NULL pointer return
authorVolker Lendecke <vl@samba.org>
Tue, 15 Mar 2011 10:19:57 +0000 (11:19 +0100)
committerVolker Lendecke <vlendec@samba.org>
Tue, 15 Mar 2011 11:08:47 +0000 (12:08 +0100)
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Mar 15 12:08:48 CET 2011 on sn-devel-104

nsswitch/libwbclient/wbc_util.c

index d2783f30d2a6f95de81ddce67ebd28c9bf75f1de..6d7a96c89801523145fb414bbdcb53b8f014696c 100644 (file)
@@ -787,6 +787,10 @@ wbcErr wbcAddNamedBlob(size_t *num_blobs,
                *num_blobs + 2, sizeof(struct wbcNamedBlob),
                wbcNamedBlobDestructor);
 
+       if (blobs == NULL) {
+               return WBC_ERR_NO_MEMORY;
+       }
+
        if (*pblobs != NULL) {
                struct wbcNamedBlob *old = *pblobs;
                memcpy(blobs, old, sizeof(struct wbcNamedBlob) * (*num_blobs));