]> git.proxmox.com Git - libgit2.git/commitdiff
Config file open: don't free memory that doesn't belong to us
authorCarlos Martín Nieto <cmn@elego.de>
Tue, 31 May 2011 11:48:44 +0000 (13:48 +0200)
committerCarlos Martín Nieto <cmn@elego.de>
Tue, 31 May 2011 15:33:23 +0000 (17:33 +0200)
On error, it would free the configuration object even though it didn't
own that memory, which would cause a double-free.

This fixes the first part of Issue #210

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
src/config_file.c

index ace7cc8ffba83c6e8788fc434c647a9536ee330c..216c0741710f63917568bf0c39553bc9964640fc 100644 (file)
@@ -261,7 +261,6 @@ static int config_open(git_config_file *cfg)
  cleanup:
        cvar_list_free(&b->var_list);
        gitfo_free_buf(&b->reader.buffer);
-       free(cfg);
 
        return git__rethrow(error, "Failed to open config");
 }