diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c index 49a87686..5bad24f2 100644 --- a/libselinux/src/label_backends_android.c +++ b/libselinux/src/label_backends_android.c @@ -260,6 +260,7 @@ static void closef(struct selabel_handle *rec) free(data->spec_arr); free(data); + rec->data = NULL; } static struct selabel_lookup_rec *property_lookup(struct selabel_handle *rec, diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c index 6c6fe328..87dbd0e9 100644 --- a/libselinux/src/label_file.c +++ b/libselinux/src/label_file.c @@ -942,6 +942,7 @@ static void closef(struct selabel_handle *rec) free(last_area); } free(data); + rec->data = NULL; } // Finds all the matches of |key| in the given context. Returns the result in diff --git a/libselinux/src/label_media.c b/libselinux/src/label_media.c index 852aeada..bae065c1 100644 --- a/libselinux/src/label_media.c +++ b/libselinux/src/label_media.c @@ -183,6 +183,7 @@ static void close(struct selabel_handle *rec) free(spec_arr); free(data); + rec->data = NULL; } static struct selabel_lookup_rec *lookup(struct selabel_handle *rec, diff --git a/libselinux/src/label_x.c b/libselinux/src/label_x.c index a8decc7a..ddae4f6c 100644 --- a/libselinux/src/label_x.c +++ b/libselinux/src/label_x.c @@ -210,6 +210,7 @@ static void close(struct selabel_handle *rec) free(spec_arr); free(data); + rec->data = NULL; } static struct selabel_lookup_rec *lookup(struct selabel_handle *rec,