[PATCH 14/19] Removed a resource leak from mount/configfile.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mount/configfile.c:410: leaked_storage: Variable "config_opts"
	going out of scope leaks the storage it points to.

Signed-off-by: Steve Dickson <steved@xxxxxxxxxx>
---
 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;
-- 
2.20.1




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux