r5975: Re-arrange code and comments to make more sense.
authorJeremy Allison <jra@samba.org>
Tue, 22 Mar 2005 22:04:01 +0000 (22:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:56:14 +0000 (10:56 -0500)
Jeremy.

source/libsmb/clilist.c

index 33bf32bb94f3025a2c9c4f383f85030539477d77..eea4391e55b1db49f0ec7841bbdd4b921002df63 100644 (file)
@@ -269,18 +269,6 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
                /* point to the data bytes */
                p = rdata;
 
-               /* we might need the lastname for continuations */
-               /* and add them to the dirlist pool */
-               tdl = SMB_REALLOC(dirlist,dirlist_len + data_len);
-
-               if (!tdl) {
-                       DEBUG(0,("cli_list_new: Failed to expand dirlist\n"));
-                       break;
-               } else {
-                       dirlist = tdl;
-               }
-
                /* we might need the lastname for continuations */
                for (p2=p,i=0;i<ff_searchcount;i++) {
                        p2 += interpret_long_filename(cli,info_level,p2,&finfo);
@@ -293,6 +281,16 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
                }
 
                /* grab the data for later use */
+               /* and add them to the dirlist pool */
+               tdl = SMB_REALLOC(dirlist,dirlist_len + data_len);
+
+               if (!tdl) {
+                       DEBUG(0,("cli_list_new: Failed to expand dirlist\n"));
+                       break;
+               } else {
+                       dirlist = tdl;
+               }
+
                memcpy(dirlist+dirlist_len,p,data_len);
                dirlist_len += data_len;