Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/config_file: NULL the variant_data more safely and checker-friendly
Setting variant_data = NULL when checking for GError is valid as key_file_consume_string() returns NULL on error. However, this can confuse static checkers as Coverity that assume that variant_data might have pointed to memory before. Thus, to be safe, use g_clear_pointer() that would free any previous data. Fixes coverity issue: | CID 1445500 (rauc#4 of 4): Resource leak (RESOURCE_LEAK) | 19. overwrite_var: Overwriting variant_data in variant_data = NULL leaks the storage that variant_data points to. Signed-off-by: Enrico Joerns <[email protected]>
- Loading branch information