src/config_file: NULL the variant_data more safely and checker-friendly
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 (#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 <a2e5f936c390f36494e46e71bcfbe365bb1e8c49@pengutronix.de>

rauc/rauc,jluebbe/rauc,ejoerns/rauc,ejoerns/rauc,jluebbe/rauc,jluebbe/rauc,rauc/rauc,rauc/rauc,ejoerns/rauc