diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c index 8e7b2889..71b085ae 100644 --- a/libselinux/src/label_file.c +++ b/libselinux/src/label_file.c @@ -138,7 +138,7 @@ static int compile_regex(struct saved_data *data, struct spec *spec, const char } spec->sd = pcre_study(spec->regex, 0, &tmperrbuf); - if (!spec->sd) { + if (!spec->sd && tmperrbuf) { if (errbuf) *errbuf=tmperrbuf; return -1;