]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-user-nic: fix the wrong use of realloc
authorLibo Chen <clbchenlibo.chen@huawei.com>
Fri, 13 Dec 2013 03:52:17 +0000 (11:52 +0800)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Fri, 13 Dec 2013 04:24:33 +0000 (22:24 -0600)
fix the wrong use of realloc

Signed-off-by: Libo Chen <clbchenlibo.chen@huawei.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_user_nic.c

index caa411a4af0236025de0b51f5ed0daa215a7da5b..ac7a242c97ac751508e6c5c2e8cf66e0b6ec8aa5 100644 (file)
@@ -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;