diff options
author | Robert Foss <robert.foss@collabora.com> | 2017-01-16 10:53:58 -0500 |
---|---|---|
committer | Robert Foss <robert.foss@collabora.com> | 2017-01-20 09:30:36 -0500 |
commit | 900f1d4de71bb65443a5251f9e95a14633c6edcb (patch) | |
tree | fade2d8a6de4d0f8098bbdae1c0be2c47354abab /lib/igt_kms.c | |
parent | b1f931b0c3be12d52d9b15627eb1b2fb2efdd467 (diff) |
lib/igt_kms: Set free'd pointer to NULL
Avoid double free's by setting the free'd pointer to NULL after
free.
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r-- | lib/igt_kms.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 8c10568a..52e1f179 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1700,6 +1700,7 @@ static void igt_output_fini(igt_output_t *output) { kmstest_free_connector_config(&output->config); free(output->name); + output->name = NULL; } /** @@ -1719,8 +1720,9 @@ void igt_display_fini(igt_display_t *display) for (i = 0; i < display->n_outputs; i++) igt_output_fini(&display->outputs[i]); free(display->outputs); - free(display->pipes); display->outputs = NULL; + free(display->pipes); + display->pipes = NULL; } static void igt_display_refresh(igt_display_t *display) |