[ASAN] sysroot: Fix leak/double free of keyfile origin

Use autoptr rather than manual cleanup.  The double free isn't a
security problem, since we trust origin files.

Closes: #598
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2016-11-30 18:51:26 +00:00
1 parent 3a459bac2d
commit 1bb6e51486
2 files changed
+2 -6

No files matched your search

+1 -1
View File
@@ -133,7 +133,6 @@ OstreeDeployment *
ostree_deployment_clone (OstreeDeployment *self)
{
glnx_unref_object OstreeBootconfigParser *new_bootconfig = NULL;
GKeyFile *new_origin = NULL;
OstreeDeployment *ret = ostree_deployment_new (self->index, self->osname, self->csum,
self->deployserial,
self->bootcsum, self->bootserial);
@@ -143,6 +142,7 @@ ostree_deployment_clone (OstreeDeployment *self)
if (self->origin)
{
g_autoptr(GKeyFile) new_origin = NULL;
g_autofree char *data = NULL;
gsize len;
gboolean success;