diff --git a/src/swtpm/common.c b/src/swtpm/common.c index 42d99ec18..2868dda80 100644 --- a/src/swtpm/common.c +++ b/src/swtpm/common.c @@ -1531,7 +1531,8 @@ static int parse_profile_options(const char *options, char **json_profile) error: if (profilefd >= 0) close(profilefd); - g_error_free(gerror); + if (gerror) + g_error_free(gerror); SWTPM_G_FREE(*json_profile); option_values_free(ovs); free(error);