summaryrefslogtreecommitdiff
path: root/src/bin/evas
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-01-09 16:10:40 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-01-09 16:12:54 +0900
commit3b06d11fdfdfbdf64bceaee8bc4a9685b1941b9c (patch)
treeb00bfec682c00f2af0effe88de16a88a274a3f3b /src/bin/evas
parentbd0d03fbcf467176d0169cf38a37aee5486d5f5a (diff)
Evas cserve2: Fix crash in cserve2 when slaves die
If a slave dies (eg. killed) when it's idle, then cserve2 will crash miserably at the next request. Indeed, the dead slave's corpse was removed from the working slaves' list but not from the lazy idle slaves list. Also, set read buffer to NULL after free. Just in case. We never know :)
Diffstat (limited to 'src/bin/evas')
-rw-r--r--src/bin/evas/evas_cserve2_messages.c1
-rw-r--r--src/bin/evas/evas_cserve2_requests.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/bin/evas/evas_cserve2_messages.c b/src/bin/evas/evas_cserve2_messages.c
index 168bd72d6c..8f4f64c371 100644
--- a/src/bin/evas/evas_cserve2_messages.c
+++ b/src/bin/evas/evas_cserve2_messages.c
@@ -42,6 +42,7 @@ _client_msg_free(Client *client)
42{ 42{
43 client->msg.reading = EINA_FALSE; 43 client->msg.reading = EINA_FALSE;
44 free(client->msg.buf); 44 free(client->msg.buf);
45 client->msg.buf = NULL;
45} 46}
46 47
47static void 48static void
diff --git a/src/bin/evas/evas_cserve2_requests.c b/src/bin/evas/evas_cserve2_requests.c
index 98300feb45..08600482c5 100644
--- a/src/bin/evas/evas_cserve2_requests.c
+++ b/src/bin/evas/evas_cserve2_requests.c
@@ -432,11 +432,13 @@ _slave_dead_cb(Slave *s EINA_UNUSED, void *data)
432 Slave_Worker *sw = data; 432 Slave_Worker *sw = data;
433 Slave_Request *req = sw->data; 433 Slave_Request *req = sw->data;
434 Eina_List **working = &_workers[sw->type].working; 434 Eina_List **working = &_workers[sw->type].working;
435 Eina_List **idle = &_workers[sw->type].idle;
435 436
436 if (req) 437 if (req)
437 _cserve2_request_failed(req, CSERVE2_LOADER_DIED); 438 _cserve2_request_failed(req, CSERVE2_LOADER_DIED);
438 439
439 *working = eina_list_remove(*working, sw); 440 *working = eina_list_remove(*working, sw);
441 *idle = eina_list_remove(*idle, sw);
440 free(sw); 442 free(sw);
441} 443}
442 444