]> git.proxmox.com Git - libgit2.git/commitdiff
git_odb_object_free: don't segfault w/ arg == NULL
authorMichael Schubert <schu@schu.io>
Sun, 1 Jul 2012 17:44:22 +0000 (19:44 +0200)
committerMichael Schubert <schu@schu.io>
Tue, 9 Oct 2012 19:28:31 +0000 (21:28 +0200)
src/odb.c

index d951bc51b49f12d3269e5f3e2cda0db6adf3a1ba..7c21598f09bbb42e78d38ef621b4e01b45e4fe0e 100644 (file)
--- a/src/odb.c
+++ b/src/odb.c
@@ -107,6 +107,9 @@ git_otype git_odb_object_type(git_odb_object *object)
 
 void git_odb_object_free(git_odb_object *object)
 {
+       if (object == NULL)
+               return;
+
        git_cached_obj_decref((git_cached_obj *)object, &free_odb_object);
 }