From: Volker Lendecke Date: Mon, 15 Jun 2009 05:45:47 +0000 (+0200) Subject: Do a correct TALLOC_FREE in an error case X-Git-Tag: tdb-1.1.5~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c3580c5de63265c54924a5f171e858a0bfb2a79;p=thirdparty%2Fsamba.git Do a correct TALLOC_FREE in an error case --- diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 74aaf0256c3..f496ae5edd3 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -1823,7 +1823,10 @@ static WERROR move_driver_file_to_download_area(TALLOC_CTX *mem_ctx, new_name = talloc_asprintf(mem_ctx, "%s/%d/%s", short_architecture, driver_version, driver_file); - W_ERROR_HAVE_NO_MEMORY(new_name); + if (new_name == NULL) { + TALLOC_FREE(old_name); + return WERR_NOMEM; + } if (version != -1 && (version = file_version_is_newer(conn, old_name, new_name)) > 0) {