summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/util/xfile.c3
-rw-r--r--lib/util/xfile.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/util/xfile.c b/lib/util/xfile.c
index b758b1fa9f..7cfb68018e 100644
--- a/lib/util/xfile.c
+++ b/lib/util/xfile.c
@@ -405,11 +405,12 @@ XFILE *x_fdup(const XFILE *f)
return NULL;
}
- ret = SMB_CALLOC_ARRAY(XFILE, 1);
+ ret = malloc_p(XFILE);
if (!ret) {
close(fd);
return NULL;
}
+ memset(ret, 0, sizeof(XFILE));
ret->fd = fd;
ret->open_flags = f->open_flags;
diff --git a/lib/util/xfile.h b/lib/util/xfile.h
index 2cc369d8d8..aa14b7c30a 100644
--- a/lib/util/xfile.h
+++ b/lib/util/xfile.h
@@ -62,7 +62,7 @@ int x_fclose(XFILE *f);
size_t x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f);
/** thank goodness for asprintf() */
-int x_fileno(XFILE *f);
+int x_fileno(const XFILE *f);
/** simulate fflush() */
int x_fflush(XFILE *f);