r16338: Fix Klocwork ID 150
authorVolker Lendecke <vlendec@samba.org>
Sun, 18 Jun 2006 09:26:05 +0000 (09:26 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:17:36 +0000 (11:17 -0500)
source/client/client.c
source/client/smbctool.c

index d7fe4d43c32fac3840e4a4ff542fea3d7a6918ed..0a695436f572434d55835f3fce79ab013fcc087d 100644 (file)
@@ -447,7 +447,14 @@ static void adjust_do_list_queue(void)
         * If the starting point of the queue is more than half way through,
         * move everything toward the beginning.
         */
-       if (do_list_queue && (do_list_queue_start == do_list_queue_end)) {
+
+       if (do_list_queue == NULL) {
+               DEBUG(4,("do_list_queue is empty\n"));
+               do_list_queue_start = do_list_queue_end = 0;
+               return;
+       }
+               
+       if (do_list_queue_start == do_list_queue_end) {
                DEBUG(4,("do_list_queue is empty\n"));
                do_list_queue_start = do_list_queue_end = 0;
                *do_list_queue = '\0';
index b3acca55738479b54397cfc8adfa7e6648cdfe5f..3233ee495546f0350b7faefabfead569eb941c79 100644 (file)
@@ -528,7 +528,14 @@ static void adjust_do_list_queue(void)
         * If the starting point of the queue is more than half way through,
         * move everything toward the beginning.
         */
-       if (do_list_queue && (do_list_queue_start == do_list_queue_end)) {
+
+       if (do_list_queue == NULL) {
+               DEBUG(4,("do_list_queue is empty\n"));
+               do_list_queue_start = do_list_queue_end = 0;
+               return;
+       }
+               
+       if (do_list_queue_start == do_list_queue_end) {
                DEBUG(4,("do_list_queue is empty\n"));
                do_list_queue_start = do_list_queue_end = 0;
                *do_list_queue = '\0';