summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/compat.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-07-13 10:29:48 +0200
committerAnand Avati <avati@redhat.com>2012-07-13 14:03:42 -0700
commit7820b2c1f88b207a8b1270b8c3cb3b797b7563d2 (patch)
tree5a383d85eb18399cf7506a90cc7627c749ccf9b8 /libglusterfs/src/compat.c
parent2dc0d32e5d8b205fa407073b209bb663d546dde8 (diff)
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 <meyering@redhat.com> BUG: 839925 Change-Id: I10e4ecff16c3749fe17c2831c516737e08a3205a Reviewed-on: http://review.gluster.com/3661 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs/src/compat.c')
-rw-r--r--libglusterfs/src/compat.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/libglusterfs/src/compat.c b/libglusterfs/src/compat.c
index 99a0041a5..2f02eeac5 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);
}