]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
printing: Simplify pack_devicemode()
authorVolker Lendecke <vl@samba.org>
Wed, 12 May 2021 16:22:52 +0000 (18:22 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 4 Jun 2021 16:47:34 +0000 (16:47 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/printing/printing.c

index 982eb4f9cddaf699ea27517a22bdc26c4256ec70..415f86e6745f11383d24f6dd2f8d3af7dcdaed24 100644 (file)
@@ -168,7 +168,7 @@ static TDB_DATA print_key(uint32_t jobid, uint32_t *tmp)
 static int pack_devicemode(struct spoolss_DeviceMode *devmode, uint8_t *buf, int buflen)
 {
        enum ndr_err_code ndr_err;
-       DATA_BLOB blob;
+       DATA_BLOB blob = { .data = NULL };
        int len = 0;
 
        if (devmode) {
@@ -181,8 +181,6 @@ static int pack_devicemode(struct spoolss_DeviceMode *devmode, uint8_t *buf, int
                                   "error encoding spoolss_DeviceMode\n"));
                        goto done;
                }
-       } else {
-               ZERO_STRUCT(blob);
        }
 
        len = tdb_pack(buf, buflen, "B", blob.length, blob.data);