summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormandyke <mandyke@gmail.com>2013-05-10 14:36:27 +0000
committermandyke <mandyke@gmail.com>2013-05-10 14:36:27 +0000
commit1e242be188b3affbec3050281ef033d4a5589513 (patch)
tree001c63bbb1aa9f2ff122e9c48a2ead8d2c4fe245
parentd26eb2c7e614f7b66f9929e551aa037199f702d2 (diff)
downloaddistcc-git-1e242be188b3affbec3050281ef033d4a5589513.tar.gz
Avoid potential dereference of uninitialized pointer.
Fixes issue 28
-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;
}