From 83a653fadbdb3167ac53b51b2694d2fd6baf962b Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Thu, 20 Feb 2014 19:47:49 +0100 Subject: [PATCH] clitar: propagate make_remote_path() talloc errors Signed-off-by: David Disseldorp Reviewed-by: Andrew Bartlett --- source3/client/clitar.c | 17 ++++++++++++++--- 1 file 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, '\\'); -- 2.34.1