Skip to content

Commit

Permalink
Fix memory leaks in dev_c7200_pa_bri_init.
Browse files Browse the repository at this point in the history
Fixes #109
  • Loading branch information
flaviojs committed Apr 2, 2024
1 parent ec5cc5f commit 813462b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/dev_c7200_bri.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ int dev_c7200_pa_bri_init(vm_instance_t *vm,struct cisco_card *card)

if (!pci_dev) {
vm_error(vm,"%s: unable to create PCI device.\n",card->dev_name);
free(d);
return(-1);
}

Expand All @@ -827,6 +828,8 @@ int dev_c7200_pa_bri_init(vm_instance_t *vm,struct cisco_card *card)
/* Create the device itself */
if (!(dev = dev_create(card->dev_name))) {
vm_error(vm,"%s: unable to create device.\n",card->dev_name);
pci_dev_remove(d->pci_dev);
free(d);
return(-1);
}

Expand Down

0 comments on commit 813462b

Please sign in to comment.