From 484a7c0341fe033fe26fe1e6b597ed1c456c39d4 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 17 Sep 2001 02:19:44 +0000 Subject: move to SAFE_FREE() (This used to be commit 60e907b7e8e1c008463a88ed2b076344278986ef) --- source3/lib/xfile.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/lib/xfile.c') diff --git a/source3/lib/xfile.c b/source3/lib/xfile.c index 3a86d2469d..6e21aeca58 100644 --- a/source3/lib/xfile.c +++ b/source3/lib/xfile.c @@ -57,7 +57,7 @@ int x_setvbuf(XFILE *f, char *buf, int mode, size_t size) } /* destroy any earlier buffer */ - if (f->buf) free(f->buf); + SAFE_FREE(f->buf); f->buf = 0; f->bufsize = 0; f->next = NULL; @@ -111,7 +111,7 @@ XFILE *x_fopen(const char *fname, int flags, mode_t mode) ret->fd = sys_open(fname, flags, mode); if (ret->fd == -1) { - free(ret); + SAFE_FREE(ret); return NULL; } @@ -133,9 +133,9 @@ int x_fclose(XFILE *f) if (f->buf) { /* make sure data can't leak into a later malloc */ memset(f->buf, 0, f->bufsize); - free(f->buf); + SAFE_FREE(f->buf); } - free(f); + SAFE_FREE(f); return ret; } @@ -191,7 +191,7 @@ int x_vfprintf(XFILE *f, const char *format, va_list ap) len = vasprintf(&p, format, ap); if (len <= 0) return len; ret = x_fwrite(p, 1, len, f); - free(p); + SAFE_FREE(p); return ret; } -- cgit