diff options
author | Russell Belfer <rb@github.com> | 2013-05-31 14:13:11 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-05-31 14:13:11 -0700 |
commit | 1a42dd17eb2c35fa572418f5958595cbe297d229 (patch) | |
tree | f135f3788eb20b5ac100519c41c7525f5f830457 /src/pack-objects.c | |
parent | f658dc433cae351e72b1c8b245724eafb43f5844 (diff) | |
download | libgit2-1a42dd17eb2c35fa572418f5958595cbe297d229.tar.gz |
Mutex init can fail
It is obviously quite a serious problem if this happens, but mutex
initialization can fail and we should detect it. It's a bit like
a memory allocation failure, in that you're probably pretty screwed
if this occurs, but at least we'll catch it.
Diffstat (limited to 'src/pack-objects.c')
-rw-r--r-- | src/pack-objects.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pack-objects.c b/src/pack-objects.c index 3d382026e..500104c55 100644 --- a/src/pack-objects.c +++ b/src/pack-objects.c @@ -132,7 +132,10 @@ int git_packbuilder_new(git_packbuilder **out, git_repository *repo) if (git_mutex_init(&pb->cache_mutex) || git_mutex_init(&pb->progress_mutex) || git_cond_init(&pb->progress_cond)) + { + giterr_set(GITERR_OS, "Failed to initialize packbuilder mutex"); goto on_error; + } #endif |