diff options
Diffstat (limited to 'source3/lib/util_file.c')
-rw-r--r-- | source3/lib/util_file.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c index 8eeb3475e3..35b47a2cbb 100644 --- a/source3/lib/util_file.c +++ b/source3/lib/util_file.c @@ -315,7 +315,7 @@ char *fgets_slash(char *s2,int maxlen,XFILE *f) return(s); case EOF: if (len <= 0 && !s2) - free(s); + SAFE_FREE(s); return(len>0?s:NULL); case ' ': if (start_of_line) @@ -333,7 +333,7 @@ char *fgets_slash(char *s2,int maxlen,XFILE *f) t = (char *)Realloc(s,maxlen); if (!t) { DEBUG(0,("fgets_slash: failed to expand buffer!\n")); - if (s) free(s); + SAFE_FREE(s); return(NULL); } else s = t; } @@ -363,7 +363,7 @@ char *file_pload(char *syscmd, size_t *size) if (!tp) { DEBUG(0,("file_pload: failed to exand buffer!\n")); close(fd); - if (p) free(p); + SAFE_FREE(p); return NULL; } else p = tp; memcpy(p+total, buf, n); @@ -393,7 +393,7 @@ char *fd_load(int fd, size_t *size) if (!p) return NULL; if (read(fd, p, sbuf.st_size) != sbuf.st_size) { - free(p); + SAFE_FREE(p); return NULL; } p[sbuf.st_size] = 0; @@ -440,7 +440,7 @@ static char **file_lines_parse(char *p, size_t size, int *numlines) ret = (char **)malloc(sizeof(ret[0])*(i+2)); if (!ret) { - free(p); + SAFE_FREE(p); return NULL; } memset(ret, 0, sizeof(ret[0])*(i+2)); @@ -513,8 +513,8 @@ free lines loaded with file_lines_load void file_lines_free(char **lines) { if (!lines) return; - free(lines[0]); - free(lines); + SAFE_FREE(lines[0]); + SAFE_FREE(lines); } |