Initialize g_autofree string to NULL, not to crash when early returning

Otherwise, anytime we fail in ostree_repo_write_metadata() will cause
an invalid free to happen, and flatpak to crash.
tingping/wmclass
Mario Sanchez Prada 2017-02-23 14:27:22 +00:00
parent 6793d90b82
commit d0b5b51076
1 changed files with 1 additions and 1 deletions

View File

@ -3085,7 +3085,7 @@ flatpak_mtree_create_root (OstreeRepo *repo,
{
g_autoptr(GVariant) dirmeta = NULL;
g_autoptr(GFileInfo) file_info = g_file_info_new ();
g_autofree guchar *csum;
g_autofree guchar *csum = NULL;
g_autofree char *checksum = NULL;
g_file_info_set_name (file_info, "/");