summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2014-02-20 19:47:49 +0100
committerAndrew Bartlett <abartlet@samba.org>2014-02-21 12:03:02 +1300
commit83a653fadbdb3167ac53b51b2694d2fd6baf962b (patch)
tree727ff564570a0c5a16015f197f5a91c467229971 /source3/client
parent55de6d60ef72b105883117b36963a7a145268223 (diff)
downloadsamba-83a653fadbdb3167ac53b51b2694d2fd6baf962b.tar.gz
clitar: propagate make_remote_path() talloc errors
Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/clitar.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 4406f3ee36b..43090ec020c 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -1593,7 +1593,6 @@ static int set_remote_attr(const char *filename, uint16 new_attr, int mode)
static int make_remote_path(const char *full_path)
{
extern struct cli_state *cli;
- TALLOC_CTX *ctx = PANIC_IF_NULL(talloc_new(NULL));
char *path;
char *subpath;
char *state;
@@ -1602,9 +1601,21 @@ static int make_remote_path(const char *full_path)
int len;
NTSTATUS status;
int err = 0;
+ TALLOC_CTX *ctx = talloc_new(NULL);
+ if (ctx == NULL) {
+ return 1;
+ }
- subpath = PANIC_IF_NULL(talloc_strdup(ctx, full_path));
- path = PANIC_IF_NULL(talloc_strdup(ctx, full_path));
+ subpath = talloc_strdup(ctx, full_path);
+ if (subpath == NULL) {
+ err = 1;
+ goto out;
+ }
+ path = talloc_strdup(ctx, full_path);
+ if (path == NULL) {
+ err = 1;
+ goto out;
+ }
len = talloc_get_size(path) - 1;
last_backslash = strrchr_m(path, '\\');