summaryrefslogtreecommitdiffstats
path: root/src/agent.c
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2008-09-01 17:26:10 -0300
committerVinicius Costa Gomes <vinicius.gomes@openbossa.org>2008-09-01 19:42:37 -0300
commite3c0f1dabde976043b02858bd135b2081a9cbe90 (patch)
treecf401ac14b26cc63d40aeb1f9277c1142b231a25 /src/agent.c
parent0c05dd3dc5a18d64734a9f091d5285612e41107b (diff)
Removes the agent when the adapter is freed, if it wasn't already done
Diffstat (limited to 'src/agent.c')
-rw-r--r--src/agent.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/agent.c b/src/agent.c
index 9870cb10..c35b2500 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -217,6 +217,9 @@ struct agent *agent_create(struct adapter *adapter, const char *name,
int agent_destroy(struct agent *agent, gboolean exited)
{
+ if (!agent)
+ return 0;
+
agent->exited = exited;
agent_free(agent);
return 0;