From cc229d7042e4fc3ec9743ce37e5db0c0d4b97186 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 23 Apr 2000 08:31:10 +0000 Subject: fixed a memory leak I caused last week with my lines[] changes (This used to be commit 4c889d08aed3cebba54abbc96f28a2d1c545a4b5) --- source3/printing/nt_printing.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'source3') diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 848344f15e..c30a35e26f 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -390,7 +390,6 @@ static uint32 get_a_printer_driver_3(NT_PRINTER_DRIVER_INFO_LEVEL_3 **info_ptr, fstring driver_name; fstring architecture; NT_PRINTER_DRIVER_INFO_LEVEL_3 *info = NULL; - char *line; fstring p; char *v; int i=0; @@ -422,12 +421,8 @@ static uint32 get_a_printer_driver_3(NT_PRINTER_DRIVER_INFO_LEVEL_3 **info_ptr, ZERO_STRUCTP(info); - /* allocate a 4Kbytes buffer for parsing lines */ - if((line=(char *)malloc(4096*sizeof(char))) == NULL) - goto err; - for (lcount=0; lines[lcount]; lcount++) { - line = lines[lcount]; + char *line = lines[lcount]; v=strncpyn(p, line, sizeof(p), ':'); if (v==NULL) { -- cgit