summaryrefslogtreecommitdiffstats
path: root/src/fan/LMI_FanAssociatedSensorProvider.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2013-05-13 10:32:16 -0400
committerStephen Gallagher <sgallagh@redhat.com>2013-05-20 10:44:31 -0400
commit28430573bf212b1669e0c78c682e9b298f337ada (patch)
treed067026f24e77ba96d8780a51eb31c84c3103ab7 /src/fan/LMI_FanAssociatedSensorProvider.c
parent0c4d0fa8489362654226cf2d82a408685478a83f (diff)
downloadopenlmi-providers-28430573bf212b1669e0c78c682e9b298f337ada.tar.gz
openlmi-providers-28430573bf212b1669e0c78c682e9b298f337ada.tar.xz
openlmi-providers-28430573bf212b1669e0c78c682e9b298f337ada.zip
Fix memory leaks
Fixes Coverity issues: * 10153 * 10154 * 10155
Diffstat (limited to 'src/fan/LMI_FanAssociatedSensorProvider.c')
-rw-r--r--src/fan/LMI_FanAssociatedSensorProvider.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fan/LMI_FanAssociatedSensorProvider.c b/src/fan/LMI_FanAssociatedSensorProvider.c
index b462e83..4253e96 100644
--- a/src/fan/LMI_FanAssociatedSensorProvider.c
+++ b/src/fan/LMI_FanAssociatedSensorProvider.c
@@ -56,6 +56,7 @@ static CMPIStatus LMI_FanAssociatedSensorEnumInstances(
const char** properties)
{
const char *ns = KNameSpace(cop);
+ CMPIStatus status;
struct cim_fan *sptr = NULL;
struct fanlist *lptr = NULL, *fans = NULL;
@@ -87,9 +88,15 @@ static CMPIStatus LMI_FanAssociatedSensorEnumInstances(
LMI_FanAssociatedSensor_Set_Antecedent(&w, &fanSensor);
LMI_FanAssociatedSensor_Set_Dependent(&w, &fan);
- KReturnInstance(cr, w);
+ status = __KReturnInstance((cr), &(w).__base);
+ if (!KOkay(status)) {
+ free_fanlist(fans);
+ return status;
+ }
+
lptr = lptr->next;
}
+ free_fanlist(fans);
CMReturn(CMPI_RC_OK);
}