uwrap: Log error if we are out of memory.
authorAndreas Schneider <asn@samba.org>
Fri, 30 May 2014 13:52:00 +0000 (15:52 +0200)
committerMichael Adam <obnox@samba.org>
Mon, 2 Jun 2014 07:50:31 +0000 (09:50 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
src/uid_wrapper.c

index eec6d96742399802489b48eda5b36b431c082ece..0bc961ebdf73705e447dd743ef574d1a9ca6e98c 100644 (file)
@@ -490,12 +490,14 @@ static int uwrap_new_id(pthread_t tid, bool do_alloc)
        if (do_alloc) {
                id = malloc(sizeof(struct uwrap_thread));
                if (id == NULL) {
+                       UWRAP_LOG(UWRAP_LOG_ERROR, "Unable to allocate memory");
                        errno = ENOMEM;
                        return -1;
                }
 
                id->groups = malloc(sizeof(gid_t) * 1);
                if (id->groups == NULL) {
+                       UWRAP_LOG(UWRAP_LOG_ERROR, "Unable to allocate memory");
                        SAFE_FREE(id);
                        errno = ENOMEM;
                        return -1;