r16153: Fix possible NULL dereference found by Klocwork # 252
authorVolker Lendecke <vlendec@samba.org>
Mon, 12 Jun 2006 12:45:06 +0000 (12:45 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:17:23 +0000 (11:17 -0500)
(This used to be commit 128260527b90d77ca3dfc900e012018ef00ba9e0)

source3/lib/ldap_escape.c

index 3feb0e0c44ef202b5373de931978eede2046349f..fcb787e9e8556dea396a8dcffe2a2de717cd6ef5 100644 (file)
@@ -40,6 +40,10 @@ char *escape_ldap_string_alloc(const char *s)
        const char *sub;
        int i = 0;
        char *p = output;
+
+       if (output == NULL) {
+               return NULL;
+       }
        
        while (*s)
        {