]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Simplify ad_alloc()
authorVolker Lendecke <vl@samba.org>
Tue, 25 Feb 2025 16:27:20 +0000 (17:27 +0100)
committerVolker Lendecke <vl@samba.org>
Thu, 27 Mar 2025 13:13:31 +0000 (13:13 +0000)
I don't see how "adsize" can be 0 here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/lib/adouble.c

index 9a11498fda7e947609d73b4953e035740891f50d..e4b8b663c072cd108cce14066ebafd4f6dea691a 100644 (file)
@@ -2516,12 +2516,10 @@ static struct adouble *ad_alloc(TALLOC_CTX *ctx,
                goto exit;
        }
 
-       if (adsize) {
-               ad->ad_data = talloc_zero_array(ad, char, adsize);
-               if (ad->ad_data == NULL) {
-                       rc = -1;
-                       goto exit;
-               }
+       ad->ad_data = talloc_zero_array(ad, char, adsize);
+       if (ad->ad_data == NULL) {
+               rc = -1;
+               goto exit;
        }
 
        ad->ad_type = type;