From: Libo Chen Date: Fri, 13 Dec 2013 03:52:17 +0000 (+0800) Subject: lxc-user-nic: fix the wrong use of realloc X-Git-Tag: lxc-1.0.0.beta1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d127727fb83efe1514d18a74c3c720f52c3e305;p=thirdparty%2Flxc.git lxc-user-nic: fix the wrong use of realloc fix the wrong use of realloc Signed-off-by: Libo Chen Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxc_user_nic.c b/src/lxc/lxc_user_nic.c index caa411a4a..ac7a242c9 100644 --- a/src/lxc/lxc_user_nic.c +++ b/src/lxc/lxc_user_nic.c @@ -318,7 +318,7 @@ static bool cull_entries(int fd, char *me, char *t, char *br) p = buf; e = buf + len; while ((p = find_line(p, e, me, t, br)) != NULL) { - struct entry_line *newe = realloc(entry_lines, n+1); + struct entry_line *newe = realloc(entry_lines, sizeof(*entry_lines)*(n+1)); if (!newe) { free(entry_lines); return false;