open-iscsi/0018-fwparam_pcc-mulitple-resource-leaks.patch
2020-05-12 17:27:41 +08:00

40 lines
1.2 KiB
Diff

From f7d92a5f0a788179bf804dd898d2b5238da5d2d1 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Thu, 31 Oct 2019 14:24:53 -0700
Subject: [PATCH 39/43] fwparam_pcc mulitple resource leaks
Resource Leak: Variable mac_file going out of scope leaks the storage it points to.
Resource Leak: Handle variable mac_fd going out of scope leaks the storage it points to.
---
utils/fwparam_ibft/fwparam_ppc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/utils/fwparam_ibft/fwparam_ppc.c b/utils/fwparam_ibft/fwparam_ppc.c
index 52a5c50..429d45c 100644
--- a/utils/fwparam_ibft/fwparam_ppc.c
+++ b/utils/fwparam_ibft/fwparam_ppc.c
@@ -132,6 +132,7 @@ static int locate_mac(const char *devtree, struct ofw_dev *ofwdev)
error = errno;
fprintf(stderr, "%s: open %s, %s\n", __func__, mac_file,
strerror(errno));
+ free(mac_file);
goto lpm_bail;
}
@@ -140,12 +141,10 @@ static int locate_mac(const char *devtree, struct ofw_dev *ofwdev)
error = EIO;
fprintf(stderr, "%s: read %s, %s\n", __func__, mac_file,
strerror(errno));
- goto lpm_bail;
}
free(mac_file);
close(mac_fd);
-
lpm_bail:
return error;
}
--
2.21.0