diff options
author | Simo Sorce <idra@samba.org> | 2001-09-15 14:03:25 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2001-09-15 14:03:25 +0000 |
commit | 13301415ca339845d63a3c86cd916d00f646dba1 (patch) | |
tree | 7be84b2e7e05a00a56c31f81ddefbe0c301e1a5e /source3/utils | |
parent | 72c35310b2b0d39c077c50a2175c76ced5d4c662 (diff) | |
download | samba-13301415ca339845d63a3c86cd916d00f646dba1.tar.gz samba-13301415ca339845d63a3c86cd916d00f646dba1.tar.bz2 samba-13301415ca339845d63a3c86cd916d00f646dba1.zip |
free memory before returning.
tx Andreas Moroder.
(This used to be commit 8d60a825f74a340beba11193a28fd83b0c4a8129)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/make_printerdef.c | 7 |
1 files changed, 7 insertions, 0 deletions
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); } |