mdssvc: Move a variable declaration closer to its use
authorVolker Lendecke <vl@samba.org>
Fri, 3 Aug 2018 10:45:59 +0000 (12:45 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 14 Sep 2018 08:48:47 +0000 (10:48 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Sep 14 10:48:47 CEST 2018 on sn-devel-144

source3/rpc_server/mdssvc/marshalling.c

index af059545759705075c0b8c7fda0534a603c8d139..b5931c7f060fd410cf08de109400e5cb8140c108 100644 (file)
@@ -1057,7 +1057,6 @@ static ssize_t sl_unpack_loop(DALLOC_CTX *query,
 {
        int i, toc_index, subcount;
        uint64_t result;
-       sl_nil_t nil;
 
        while (count > 0) {
                struct sl_tag tag;
@@ -1106,12 +1105,13 @@ static ssize_t sl_unpack_loop(DALLOC_CTX *query,
                        break;
                }
 
-               case SQ_TYPE_NULL:
+               case SQ_TYPE_NULL: {
+                       sl_nil_t nil = 0;
+
                        subcount = tag.count;
                        if (subcount > count) {
                                return -1;
                        }
-                       nil = 0;
                        for (i = 0; i < subcount; i++) {
                                result = dalloc_add_copy(query, &nil, sl_nil_t);
                                if (result != 0) {
@@ -1121,6 +1121,7 @@ static ssize_t sl_unpack_loop(DALLOC_CTX *query,
                        offset += tag.size;
                        count -= subcount;
                        break;
+               }
 
                case SQ_TYPE_BOOL: {
                        sl_bool_t b = (tag.count != 0);