diff --git a/libselinux/src/context.c b/libselinux/src/context.c index 090264a4..ce425880 100644 --- a/libselinux/src/context.c +++ b/libselinux/src/context.c @@ -151,14 +151,14 @@ static int set_comp(context_private_t * n, int idx, const char *str) if (str) { t = (char *)malloc(strlen(str) + 1); if (!t) { - return 1; + return -1; } for (p = str; *p; p++) { if (*p == '\t' || *p == '\n' || *p == '\r' || ((*p == ':' || *p == ' ') && idx != COMP_RANGE)) { free(t); errno = EINVAL; - return 1; + return -1; } } strcpy(t, str);