diff options
author | Simo Sorce <idra@samba.org> | 2001-09-17 11:25:41 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2001-09-17 11:25:41 +0000 |
commit | 61b2794968faa35dc91edce17e9b91e5366c3514 (patch) | |
tree | 3fd9ec24adcdf149263066754f5e51ac7a4e14e0 /source3/smbwrapper/smbw_dir.c | |
parent | 87945989c0383bd012be7ab8bc5920b6d03fa105 (diff) | |
download | samba-61b2794968faa35dc91edce17e9b91e5366c3514.tar.gz samba-61b2794968faa35dc91edce17e9b91e5366c3514.tar.bz2 samba-61b2794968faa35dc91edce17e9b91e5366c3514.zip |
move to SAFE_FREE()
(This used to be commit a95943fde0ad89ae3f2deca2f7ba9cb5ab612b74)
Diffstat (limited to 'source3/smbwrapper/smbw_dir.c')
-rw-r--r-- | source3/smbwrapper/smbw_dir.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/source3/smbwrapper/smbw_dir.c b/source3/smbwrapper/smbw_dir.c index d9dae454bb..6cbc34391f 100644 --- a/source3/smbwrapper/smbw_dir.c +++ b/source3/smbwrapper/smbw_dir.c @@ -64,12 +64,12 @@ free a smbw_dir structure and all entries *******************************************************/ static void free_dir(struct smbw_dir *dir) { - if (dir->list) { - free(dir->list); - } - if (dir->path) free(dir->path); + if(!dir) return; + + SAFE_FREE(dir->list); + SAFE_FREE(dir->path); ZERO_STRUCTP(dir); - free(dir); + SAFE_FREE(dir); } static struct smbw_dir *cur_dir; @@ -274,10 +274,8 @@ int smbw_dir_open(const char *fname) return dir->fd; failed: - if (dir) { - free_dir(dir); - } - + free_dir(dir); + return -1; } |