From 7820b2c1f88b207a8b1270b8c3cb3b797b7563d2 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 13 Jul 2012 10:29:48 +0200 Subject: remove useless if-before-free (and free-like) functions See comments in http://bugzilla.redhat.com/839925 for the code to perform this change. Signed-off-by: Jim Meyering BUG: 839925 Change-Id: I10e4ecff16c3749fe17c2831c516737e08a3205a Reviewed-on: http://review.gluster.com/3661 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/compat.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'libglusterfs/src/compat.c') diff --git a/libglusterfs/src/compat.c b/libglusterfs/src/compat.c index 99a0041a5cf..2f02eeac544 100644 --- a/libglusterfs/src/compat.c +++ b/libglusterfs/src/compat.c @@ -142,8 +142,7 @@ done: *path = export_path; } out: - if (freeptr) - GF_FREE (freeptr); + GF_FREE (freeptr); if (ret && export_path) GF_FREE (export_path); @@ -195,8 +194,7 @@ solaris_xattr_resolve_path (const char *real_path, char **path) *path = gf_strdup (xattr_path); } out: - if (export_path) - GF_FREE (export_path); + GF_FREE (export_path); if (*path) return 0; else @@ -230,8 +228,7 @@ solaris_setxattr(const char *path, const char* key, const char *value, path, errno); ret = -1; } - if (mapped_path) - GF_FREE (mapped_path); + GF_FREE (mapped_path); return ret; } @@ -297,8 +294,7 @@ solaris_listxattr(const char *path, char *list, size_t size) close (attrdirfd); } out: - if (mapped_path) - GF_FREE (mapped_path); + GF_FREE (mapped_path); return len; } @@ -380,8 +376,7 @@ solaris_removexattr(const char *path, const char* key) ret = -1; } - if (mapped_path) - GF_FREE (mapped_path); + GF_FREE (mapped_path); return ret; } @@ -421,8 +416,7 @@ solaris_getxattr(const char *path, errno = ENODATA; ret = -1; } - if (mapped_path) - GF_FREE (mapped_path); + GF_FREE (mapped_path); return ret; } @@ -494,8 +488,7 @@ int solaris_unlink (const char *path) } out: - if (mapped_path) - GF_FREE (mapped_path); + GF_FREE (mapped_path); return unlink (path); } -- cgit