From 13301415ca339845d63a3c86cd916d00f646dba1 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 15 Sep 2001 14:03:25 +0000 Subject: free memory before returning. tx Andreas Moroder. (This used to be commit 8d60a825f74a340beba11193a28fd83b0c4a8129) --- source3/utils/make_printerdef.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source3/utils/make_printerdef.c b/source3/utils/make_printerdef.c index 5107b124a7..bfbf6fa499 100644 --- a/source3/utils/make_printerdef.c +++ b/source3/utils/make_printerdef.c @@ -154,6 +154,8 @@ static void lookup_strings(FILE *fichier) temp2=(char *)malloc(sizeof(pstring)); if(temp == NULL || temp2 == NULL) { + safe_free(temp); + safe_free(temp2); fprintf(stderr,"lookup_strings: malloc fail !\n"); exit(1); } @@ -216,6 +218,8 @@ static void lookup_entry(FILE *fichier,char *chaine) temp2=(char *)malloc(sizeof(pstring)); if(temp == NULL || temp2 == NULL) { + safe_free(temp); + safe_free(temp2); fprintf(stderr,"lookup_entry: malloc fail !\n"); exit(1); } @@ -272,6 +276,9 @@ static char *find_desc(FILE *fichier,char *text) long_desc=(char *)malloc(sizeof(pstring)); short_desc=(char *)malloc(sizeof(pstring)); if (!chaine || !long_desc || !short_desc) { + safe_free(chaine); + safe_free(long_desc); + safe_free(short_desc); fprintf(stderr,"find_desc: Unable to malloc memory\n"); exit(1); } -- cgit