libsync: Fix a double-free.

sync_file_info, the only caller of legacy_fence_info_to_sync_file_info,
unconditionally frees legacy_info after
legacy_fence_info_to_sync_file_info is called. So, if this calloc
fails, we'll end up freeing legacy_info twice.

Bug: 27101951
Test: mma. Static analyzer complaint about double-free is gone.
Change-Id: I43bf820af9aadf30cb8eabce57416f69a8fccf89
This commit is contained in:
George Burgess IV 2017-09-05 16:26:36 -07:00
parent f899548cdb
commit 4ff5ff29d2
1 changed files with 0 additions and 1 deletions

View File

@ -275,7 +275,6 @@ static struct sync_file_info* legacy_fence_info_to_sync_file_info(
info = calloc(1, sizeof(struct sync_file_info) +
num_fences * sizeof(struct sync_fence_info));
if (!info) {
free(legacy_info);
return NULL;
}
info->sync_fence_info = (__u64)(uintptr_t)(info + 1);