[PATCH] lxc-user-nic: fix the wrong use of realloc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



fix the wrong use of realloc

Signed-off-by: Libo Chen <clbchenlibo.chen@xxxxxxxxxx>
---
 src/lxc/lxc_user_nic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/lxc_user_nic.c b/src/lxc/lxc_user_nic.c
index caa411a..ac7a242 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;
-- 
1.8.2.2

_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/containers




[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux