summaryrefslogtreecommitdiff
path: root/src/lib/evas/cserve2
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-01-07 15:46:44 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-01-07 15:51:56 +0900
commit5f601cd7539de157d0d07df420349fbab47008a9 (patch)
tree64efdf50fc4ab660e38e28920476b93986dcd5c6 /src/lib/evas/cserve2
parentcb9dedd44dd3f89a169b3d35da72c758d31fc961 (diff)
Evas: Fix some clang warnings in evas_cs2_client.c
- Invalid alloc size (typo) - Initialized value never read (set twice) - Potential memleak (call free(msg) in case of send error) - Null pointer dereference (check nullity) There are still other warnings, but I believe these are false positives.
Diffstat (limited to 'src/lib/evas/cserve2')
-rw-r--r--src/lib/evas/cserve2/evas_cs2_client.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c
index 7609f4b8fd..a1224e4746 100644
--- a/src/lib/evas/cserve2/evas_cs2_client.c
+++ b/src/lib/evas/cserve2/evas_cs2_client.c
@@ -418,7 +418,11 @@ _server_send(void *buf, int size, Op_Callback cb, void *data)
418 418
419on_error: 419on_error:
420 if (!_request_answer_required(type, NULL)) 420 if (!_request_answer_required(type, NULL))
421 return EINA_FALSE; 421 {
422 free(buf);
423 return EINA_FALSE;
424 }
425
422 ERR("Socket error: %d %m", errno); 426 ERR("Socket error: %d %m", errno);
423 switch (errno) 427 switch (errno)
424 { 428 {
@@ -701,7 +705,6 @@ _image_opened_cb(void *data, const void *msg_received, int size)
701 } 705 }
702 else 706 else
703 ERR("Invalid message type received: %d (%s)", answer->type, __FUNCTION__); 707 ERR("Invalid message type received: %d (%s)", answer->type, __FUNCTION__);
704 fentry = ie->data1;
705 EINA_REFCOUNT_UNREF(fentry) 708 EINA_REFCOUNT_UNREF(fentry)
706 eina_hash_del(_file_entries, fentry->hkey, fentry); 709 eina_hash_del(_file_entries, fentry->hkey, fentry);
707 return EINA_TRUE; 710 return EINA_TRUE;
@@ -1717,7 +1720,7 @@ _glyph_map_remap_check(Glyph_Map *map, const char *idxpath, const char *datapath
1717 // Reopen mempool 1720 // Reopen mempool
1718 if (EINA_REFCOUNT_GET(&map->mempool) > 0) 1721 if (EINA_REFCOUNT_GET(&map->mempool) > 0)
1719 { 1722 {
1720 oldbuf = calloc(1, sizeof(Glyph_Map)); 1723 oldbuf = calloc(1, sizeof(*oldbuf));
1721 oldbuf->f = map->mempool.f; 1724 oldbuf->f = map->mempool.f;
1722 oldbuf->data = map->mempool.data; 1725 oldbuf->data = map->mempool.data;
1723 oldbuf->size = map->mempool.size; 1726 oldbuf->size = map->mempool.size;
@@ -1779,7 +1782,7 @@ _glyph_map_remap_check(Glyph_Map *map, const char *idxpath, const char *datapath
1779 1782
1780 if (EINA_REFCOUNT_GET(&map->mempool) > 0) 1783 if (EINA_REFCOUNT_GET(&map->mempool) > 0)
1781 { 1784 {
1782 oldbuf = calloc(1, sizeof(Glyph_Map)); 1785 oldbuf = calloc(1, sizeof(*oldbuf));
1783 oldbuf->f = eina_file_dup(map->mempool.f); 1786 oldbuf->f = eina_file_dup(map->mempool.f);
1784 oldbuf->data = map->mempool.data; 1787 oldbuf->data = map->mempool.data;
1785 oldbuf->size = map->mempool.size; 1788 oldbuf->size = map->mempool.size;
@@ -2644,6 +2647,9 @@ _shared_image_entry_file_data_find(Image_Entry *ie)
2644 if (!_index.files.header || !_index.files.entries.filedata) 2647 if (!_index.files.header || !_index.files.entries.filedata)
2645 return NULL; 2648 return NULL;
2646 2649
2650 if (!ie->data1)
2651 return NULL;
2652
2647 // Direct access 2653 // Direct access
2648 fe = ie->data1; 2654 fe = ie->data1;
2649 if (fe->server_file_id) 2655 if (fe->server_file_id)