Commit 63c3090c by Qiang Huang Committed by Serge Hallyn

arguments: should return negative number when error happens

We should return -ENOMEM instead of ENOMEM when realloc fails. Signed-off-by: 's avatarQiang Huang <h.huangqiang@huawei.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 44ef0c0c
...@@ -164,7 +164,7 @@ static int lxc_arguments_lxcpath_add(struct lxc_arguments *args, ...@@ -164,7 +164,7 @@ static int lxc_arguments_lxcpath_add(struct lxc_arguments *args,
sizeof(args->lxcpath[0])); sizeof(args->lxcpath[0]));
if (args->lxcpath == NULL) { if (args->lxcpath == NULL) {
lxc_error(args, "no memory"); lxc_error(args, "no memory");
return ENOMEM; return -ENOMEM;
} }
args->lxcpath[args->lxcpath_cnt++] = lxcpath; args->lxcpath[args->lxcpath_cnt++] = lxcpath;
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment