Skip to content

Commit

Permalink
Merge pull request #147 from flaviojs/fix-memory-leak-dev_wic_serial_…
Browse files Browse the repository at this point in the history
…init

Fix memory leak in dev_wic_serial_init.
  • Loading branch information
grossmj authored Mar 9, 2024
2 parents 937bab6 + b33d7fa commit 008105d
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions common/dev_wic_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ dev_wic_serial_init(vm_instance_t *vm,char *name,u_int model,
m_uint64_t paddr,m_uint32_t len)
{
struct wic_serial_data *d;
struct vdevice *dev;

/* Allocate the private data structure for WIC */
if (!(d = malloc(sizeof(*d)))) {
Expand All @@ -143,13 +142,6 @@ dev_wic_serial_init(vm_instance_t *vm,char *name,u_int model,

memset(d,0,sizeof(*d));

/* Create the device itself */
if (!(dev = dev_create(name))) {
fprintf(stderr,"%s (WIC): unable to create device.\n",name);
free(d);
return NULL;
}

d->name = name;
d->vm = vm;

Expand Down

0 comments on commit 008105d

Please sign in to comment.