From: Andreas Schneider Date: Mon, 31 Jul 2017 08:09:52 +0000 (+0200) Subject: s3:printing: Add NULL check for state_path() X-Git-Tag: tdb-1.3.15~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fe9067bcc7d605ef0df5721ea290f920f6cf241e;p=thirdparty%2Fsamba.git s3:printing: Add NULL check for state_path() Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Sat Aug 19 05:33:41 CEST 2017 on sn-devel-144 --- diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 0a0d3f75c69..932d4d76df0 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -153,20 +153,37 @@ static bool print_driver_directories_init(void) } driver_path = state_path("DriverStore"); + if (driver_path == NULL) { + talloc_free(mem_ctx); + return false; + } + ok = directory_create_or_exist(driver_path, 0755); if (!ok) { DEBUG(1,("failed to create path %s\n", driver_path)); talloc_free(mem_ctx); return false; } + driver_path = state_path("DriverStore/FileRepository"); + if (driver_path == NULL) { + talloc_free(mem_ctx); + return false; + } + ok = directory_create_or_exist(driver_path, 0755); if (!ok) { DEBUG(1,("failed to create path %s\n", driver_path)); talloc_free(mem_ctx); return false; } + driver_path = state_path("DriverStore/Temp"); + if (driver_path == NULL) { + talloc_free(mem_ctx); + return false; + } + ok = directory_create_or_exist(driver_path, 0755); if (!ok) { DEBUG(1,("failed to create path %s\n", driver_path));