diff options
-rw-r--r-- | source3/utils/net_ads.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index af95c3a908..5134727066 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -1719,8 +1719,11 @@ static int net_ads_printer_publish(int argc, const char **argv) return -1; } - get_remote_printer_publishing_data(pipe_hnd, mem_ctx, &mods, - printername); + if (!W_ERROR_IS_OK(get_remote_printer_publishing_data(pipe_hnd, mem_ctx, &mods, + printername))) { + ads_destroy(&ads); + return -1; + } rc = ads_add_printer_entry(ads, prt_dn, mem_ctx, &mods); if (!ADS_ERR_OK(rc)) { |