Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2018-06-15 11:29:52 +02:00
parent 477e62b618
commit 4250ef64b3
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -1561,15 +1561,24 @@ static bool create_run_template(struct lxc_container *c, char *tpath,
/* note n2[n2args-1] is NULL */
n2[n2args - 5] = "--mapped-uid";
snprintf(txtuid, 20, "%d", hostuid_mapped);
ret = snprintf(txtuid, 20, "%d", hostuid_mapped);
if (ret < 0 || ret >= 20) {
free(newargv);
free(n2);
_exit(EXIT_FAILURE);
}
n2[n2args - 4] = txtuid;
n2[n2args - 3] = "--mapped-gid";
ret = snprintf(txtgid, 20, "%d", hostgid_mapped);
if (ret < 0 || ret >= 20) {
free(newargv);
free(n2);
_exit(EXIT_FAILURE);
}
n2[n2args - 2] = txtgid;
n2[n2args - 1] = NULL;
free(newargv);