Skip to content

Commit

Permalink
team: port and link_watch realloc and destroy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wipawel authored and mtomaschewski committed Aug 19, 2015
1 parent 9498548 commit 230785b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/team.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <stdlib.h>

#include <wicked/util.h>
#include <wicked/netinfo.h>
#include <wicked/team.h>
#include "util_priv.h"

Expand Down Expand Up @@ -312,7 +313,7 @@ __ni_team_link_watch_array_realloc(ni_team_link_watch_array_t *array, unsigned i
unsigned int i;

newsize = (newsize + NI_TEAM_LINK_WATCH_ARRAY_CHUNK);
newdata = xrealloc(array->data, newsize * sizeof(ni_team_link_watch_t));
newdata = xrealloc(array->data, newsize * sizeof(ni_team_link_watch_t *));
array->data = newdata;
for (i = array->count; i < newsize; ++i)
array->data[i] = NULL;
Expand Down Expand Up @@ -362,6 +363,7 @@ ni_team_port_new(void)
void
ni_team_port_free(ni_team_port_t *port)
{
ni_netdev_ref_destroy(&port->device);
free(port);
}

Expand All @@ -387,7 +389,7 @@ __ni_team_port_array_realloc(ni_team_port_array_t *array, unsigned int newsize)
unsigned int i;

newsize = (newsize + NI_TEAM_PORT_ARRAY_CHUNK);
newdata = xrealloc(array->data, newsize * sizeof(ni_team_port_t));
newdata = xrealloc(array->data, newsize * sizeof(ni_team_port_t *));
array->data = newdata;
for (i = array->count; i < newsize; ++i)
array->data[i] = NULL;
Expand Down

0 comments on commit 230785b

Please sign in to comment.