libselinux: asprintf return code must be checked

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
Dan Walsh 2012-05-25 07:11:21 -04:00 committed by Eric Paris
parent ac6ab3afc0
commit 2ca19f3f67

View File

@ -47,7 +47,8 @@ static char *selabel_sub(struct selabel_sub *ptr, const char *src)
if (strncmp(src, ptr->src, ptr->slen) == 0 ) {
if (src[ptr->slen] == '/' ||
src[ptr->slen] == 0) {
asprintf(&dst, "%s%s", ptr->dst, &src[ptr->slen]);
if (asprintf(&dst, "%s%s", ptr->dst, &src[ptr->slen]) < 0)
return NULL;
return dst;
}
}