]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbclient: fix handling errors from do_put in mput
authorRalph Boehme <slow@samba.org>
Wed, 30 Jul 2025 07:53:40 +0000 (09:53 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 8 Aug 2025 11:59:33 +0000 (11:59 +0000)
Pair-Programmed-With: Anoop C S <anoopcs@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Aug  8 11:59:33 UTC 2025 on atb-devel-224

source3/client/client.c

index e96efb9ea23fa9fdd7ea31c64fabb011b5228acc..c8b157bb0c3b371ddbbcba377bc8d52a9a5a1e27 100644 (file)
@@ -2177,6 +2177,7 @@ static int cmd_mput(void)
                ret = file_find(ctx, &file_list, ".", p, true);
                if (ret) {
                        free_file_list(file_list);
+                       file_list = NULL;
                        continue;
                }
 
@@ -2267,12 +2268,19 @@ static int cmd_mput(void)
                                        break;
                                }
                        }
-                       do_put(rname, lname, false);
+                       ret = do_put(rname, lname, false);
+                       if (ret != 0) {
+                               break;
+                       }
                }
                free_file_list(file_list);
+               file_list = NULL;
                SAFE_FREE(quest);
                SAFE_FREE(lname);
                SAFE_FREE(rname);
+               if (ret != 0) {
+                       return ret;
+               }
        }
 
        return 0;