diff options
author | Colin Guthrie <colin@mageia.org> | 2011-09-05 20:29:36 +0100 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2011-09-05 20:29:36 +0100 |
commit | 8e298848be3a1b2a83b808441adf317da2cecd47 (patch) | |
tree | 261d036b17cb56bfc60ef3c9abe21bc4cab9b7dd /src/modules/module-device-restore.c | |
parent | 03b97d0e08ed6a8578a94970390c7347d0deb9de (diff) |
device-restore: Fix use-after-free error.
Diffstat (limited to 'src/modules/module-device-restore.c')
-rw-r--r-- | src/modules/module-device-restore.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/module-device-restore.c b/src/modules/module-device-restore.c index 54afeb2e..de98035f 100644 --- a/src/modules/module-device-restore.c +++ b/src/modules/module-device-restore.c @@ -470,16 +470,19 @@ fail: pa_tagstruct_free(t); pa_datum_free(&data); - pa_xfree(name); #ifdef ENABLE_LEGACY_DATABASE_ENTRY_FORMAT /* Try again with a null port. This is used when dealing with migration from older versions */ - if (port) + if (port) { + pa_xfree(name); return perportentry_read(u, basekeyname, NULL); + } #endif pa_log_debug("Database contains invalid data for key: %s", name); + pa_xfree(name); + return NULL; } |