diff --git a/libselinux/src/label.c b/libselinux/src/label.c index 60639cfc..3300ddc0 100644 --- a/libselinux/src/label.c +++ b/libselinux/src/label.c @@ -191,9 +191,11 @@ static inline struct selabel_digest *selabel_is_digest_set return NULL; err: - free(digest->digest); - free(digest->specfile_list); - free(digest); + if (digest) { + free(digest->digest); + free(digest->specfile_list); + free(digest); + } return NULL; }