summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormandyke@gmail.com <mandyke@gmail.com@01de4be4-8c4a-0410-9132-4925637da917>2013-05-10 14:36:27 +0000
committermandyke@gmail.com <mandyke@gmail.com@01de4be4-8c4a-0410-9132-4925637da917>2013-05-10 14:36:27 +0000
commit7e5568c819b9c5198273bf5b998eda08ee0d5e20 (patch)
tree001c63bbb1aa9f2ff122e9c48a2ead8d2c4fe245
parent64a3fa83cd3c89f7b47085dda36ef03783a9d95f (diff)
downloaddistcc-7e5568c819b9c5198273bf5b998eda08ee0d5e20.tar.gz
Avoid potential dereference of uninitialized pointer.
Fixes issue 28 git-svn-id: http://distcc.googlecode.com/svn/trunk@779 01de4be4-8c4a-0410-9132-4925637da917
-rw-r--r--src/where.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/where.c b/src/where.c
index 6bd3168..2071de6 100644
--- a/src/where.c
+++ b/src/where.c
@@ -199,6 +199,8 @@ int dcc_lock_local_cpp(int *cpu_lock_fd)
int ret;
struct dcc_hostdef *chosen;
ret = dcc_lock_one(dcc_hostdef_local_cpp, &chosen, cpu_lock_fd);
- dcc_note_state(DCC_PHASE_CPP, NULL, chosen->hostname, DCC_LOCAL);
+ if (ret == 0) {
+ dcc_note_state(DCC_PHASE_CPP, NULL, chosen->hostname, DCC_LOCAL);
+ }
return ret;
}