summaryrefslogtreecommitdiff
path: root/source3/lib/xfile.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2001-09-17 02:19:44 +0000
committerSimo Sorce <idra@samba.org>2001-09-17 02:19:44 +0000
commit484a7c0341fe033fe26fe1e6b597ed1c456c39d4 (patch)
treec2f2344c757fffba5b6cc190e6ed13ef64b89266 /source3/lib/xfile.c
parent31c3f7a8b2ff62d4cfc1ed9d831b95eba0da525f (diff)
downloadsamba-484a7c0341fe033fe26fe1e6b597ed1c456c39d4.tar.gz
samba-484a7c0341fe033fe26fe1e6b597ed1c456c39d4.tar.bz2
samba-484a7c0341fe033fe26fe1e6b597ed1c456c39d4.zip
move to SAFE_FREE()
(This used to be commit 60e907b7e8e1c008463a88ed2b076344278986ef)
Diffstat (limited to 'source3/lib/xfile.c')
-rw-r--r--source3/lib/xfile.c10
1 files changed, 5 insertions, 5 deletions
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;
}