Skip to content

Commit

Permalink
8487 cfgadm_plugins/shp: memory leak in cfga_get_condition()
Browse files Browse the repository at this point in the history
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Robert Mustacchi <rm@joyent.com>
  • Loading branch information
Yuri Pankov authored and rmustacc committed Jul 29, 2017
1 parent a3bcc60 commit 3facafd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions usr/src/lib/cfgadm_plugins/shp/common/shp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1344,15 +1344,17 @@ static cfga_err_t
cfga_get_condition(hp_node_t node, ap_condition_t *cond)
{
char *condition;
char *tmpc;
cfga_err_t ret = CFGA_OK;

/* "condition" bus specific commands */
if (hp_get_private(node, PCIEHPC_PROP_SLOT_CONDITION,
&condition) != 0) {
&tmpc) != 0) {
*cond = AP_COND_UNKNOWN;
return (CFGA_ERROR);
}

condition = get_val_from_result(condition);
condition = get_val_from_result(tmpc);

if (strcmp(condition, PCIEHPC_PROP_COND_OK) == 0)
*cond = AP_COND_OK;
Expand All @@ -1365,9 +1367,10 @@ cfga_get_condition(hp_node_t node, ap_condition_t *cond)
else if (strcmp(condition, PCIEHPC_PROP_COND_UNKNOWN) == 0)
*cond = AP_COND_UNKNOWN;
else
return (CFGA_ERROR);
ret = CFGA_ERROR;

return (CFGA_OK);
free(tmpc);
return (ret);
}

/*ARGSUSED*/
Expand Down

0 comments on commit 3facafd

Please sign in to comment.