nfs-utils/6032-remove-a-resource-leak-from-mount-configfile.patch
2019-09-30 11:09:50 -04:00

26 lines
801 B
Diff

From 0e668a2e09556150c8f963817f1e5dfb99f01f6f Mon Sep 17 00:00:00 2001
From: huyan <hu.huyan@huawei.com>
Date: Mon, 17 Jun 2019 15:52:02 +0800
Subject: [PATCH] backport remove a resource leak from mount/configfile.c
---
utils/mount/configfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c
index b48b25e..93fe500 100644
--- a/utils/mount/configfile.c
+++ b/utils/mount/configfile.c
@@ -404,7 +404,7 @@ char *conf_get_mntopts(char *spec, char *mount_point,
/* list_size + optlen + ',' + '\0' */
config_opts = calloc(1, (list_size+optlen+2));
- if (server == NULL) {
+ if (config_opts == NULL) {
xlog_warn("conf_get_mountops: Unable calloc memory for config_opts");
free_all();
return mount_opts;
--
1.8.3.1