From d3e84bb525f1b34c3aac3bc7c09a4eb00d624cbd Mon Sep 17 00:00:00 2001 From: komaln Date: Sat, 26 Jan 2008 10:42:53 +0000 Subject: [PATCH] b=11230 r=Adilger Fix a memory leak. --- lustre/utils/mount_lustre.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index 79e89e6..004890c 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -389,7 +389,8 @@ int set_tunables(char *source, int src_len) if (verbose) fprintf(stderr,"warning: device %s does not match any " "entry under /sys/block\n", real_path); - return -EINVAL; + rc = -EINVAL; + goto out; } snprintf(path, sizeof(path), "%s/%s", glob_info.gl_pathv[i], @@ -399,7 +400,7 @@ int set_tunables(char *source, int src_len) if (verbose) fprintf(stderr, "warning: opening %s: %s\n", path, strerror(errno)); - return rc; + goto out; } if (strlen(buf) - 1 > 0) { @@ -410,6 +411,9 @@ int set_tunables(char *source, int src_len) fprintf(stderr, "warning: writing to %s: %s\n", path, strerror(errno)); } + +out: + globfree(&glob_info); return rc; } -- 1.8.3.1