r551: BUG 1293: fix double free in printer publishing code
authorGerald Carter <jerry@samba.org>
Fri, 7 May 2004 13:45:41 +0000 (13:45 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:51:28 +0000 (10:51 -0500)
source/printing/nt_printing.c

index fd7968f45d2aeea3779cd790d1ff63524daf0d98..0670b2543eb36bce2c181fd58edd04c19758ec30 100644 (file)
@@ -2718,14 +2718,13 @@ static WERROR publish_it(NT_PRINTER_INFO_LEVEL *printer)
        
        /* retreive the guid and store it locally */
        if (ADS_ERR_OK(ads_search_dn(ads, &res, prt_dn, attrs))) {
-               ads_memfree(ads, prt_dn);
                ads_pull_guid(ads, res, &guid);
                ads_msgfree(ads, res);
                store_printer_guid(printer->info_2, guid);
                win_rc = mod_a_printer(*printer, 2);
        } 
 
-       safe_free(prt_dn);
+       SAFE_FREE(prt_dn);
        ads_destroy(&ads);
 
        return WERR_OK;