Skip to content

Commit

Permalink
Merge pull request #148 from flaviojs/fix-memory-leaks-dev_c7200_pa_8…
Browse files Browse the repository at this point in the history
…t_init

Fix memory leaks in dev_c7200_pa_8t_init
  • Loading branch information
grossmj authored Mar 9, 2024
2 parents 008105d + cbf928f commit 370c1f7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions common/dev_c7200_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,20 @@ static int dev_c7200_pa_8t_init(vm_instance_t *vm,struct cisco_card *card)
data->mueslix[0] = dev_mueslix_init(vm,card->dev_name,1,
card->pci_bus,0,
c7200_net_irq_for_slot_port(slot,0));
if (!data->mueslix[0]) return(-1);
if (!data->mueslix[0]) {
free(data);
return(-1);
}

/* Create the 2nd Mueslix chip */
data->mueslix[1] = dev_mueslix_init(vm,card->dev_name,1,
card->pci_bus,1,
c7200_net_irq_for_slot_port(slot,1));
if (!data->mueslix[1]) return(-1);
if (!data->mueslix[1]) {
dev_mueslix_remove(data->mueslix[0]);
free(data);
return(-1);
}

/* Store device info into the router structure */
card->drv_info = data;
Expand Down

0 comments on commit 370c1f7

Please sign in to comment.