summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-04-23 02:53:34 (GMT)
committerSung-jae Park <nicesj.park@samsung.com>2013-04-23 02:53:34 (GMT)
commit8d696f93e7277360f437264a21f5c97d20d759b3 (patch)
tree30bfa955dacc7a7faf294a1a563412c42945bb03
parent5f77e1b8426962ceb6696fc78b06a2c5fad57537 (diff)
downloaddata-provider-master-submit/tizen_2.1/20130424.223847.zip
data-provider-master-submit/tizen_2.1/20130424.223847.tar.gz
data-provider-master-submit/tizen_2.1/20130424.223847.tar.bz2
Change-Id: I2b96cecd5f0e3746e2b6447d067774bc8b77d3b2
-rw-r--r--src/package.c2
-rw-r--r--src/service_common.c14
2 files changed, 13 insertions, 3 deletions
diff --git a/src/package.c b/src/package.c
index 35e4742..b0c62c1 100644
--- a/src/package.c
+++ b/src/package.c
@@ -173,7 +173,7 @@ static int slave_fault_cb(struct slave_node *slave, void *data)
return 0;
}
- package_set_fault_info(info, util_timestamp(), slave_name(slave), __func__);
+ (void)package_set_fault_info(info, util_timestamp(), slave_name(slave), __func__);
fault_broadcast_info(package_name(info), slave_name(slave), __func__);
DbgPrint("Slave critical fault - package: %s (by slave fault %s\n", package_name(info), slave_name(slave));
diff --git a/src/service_common.c b/src/service_common.c
index fd2a577..cd2f1e2 100644
--- a/src/service_common.c
+++ b/src/service_common.c
@@ -120,17 +120,23 @@ static void *client_packet_pump_main(void *data)
ret = 0;
continue;
}
- ErrPrint("Error: %s\n",strerror(errno));
+ ErrPrint("Error: %s\n", strerror(errno));
+ free(ptr);
+ ptr = NULL;
break;
} else if (ret == 0) {
ErrPrint("Timeout\n");
ret = -ETIMEDOUT;
+ free(ptr);
+ ptr = NULL;
break;
}
if (!FD_ISSET(tcb->fd, &set)) {
ErrPrint("Unexpected handler is toggled\n");
ret = -EINVAL;
+ free(ptr);
+ ptr = NULL;
break;
}
@@ -158,6 +164,7 @@ static void *client_packet_pump_main(void *data)
if (ret == 0)
ret = -ECANCELED;
free(ptr);
+ ptr = NULL;
break;
}
@@ -167,6 +174,7 @@ static void *client_packet_pump_main(void *data)
if (recv_offset == size) {
packet = packet_build(packet, packet_offset, ptr, size);
free(ptr);
+ ptr = NULL;
if (!packet) {
ret = -EFAULT;
break;
@@ -175,7 +183,7 @@ static void *client_packet_pump_main(void *data)
packet_offset += recv_offset;
size = packet_payload_size(packet);
- if (size == 0) {
+ if (size <= 0) {
recv_state = RECV_DONE;
recv_offset = 0;
break;
@@ -197,6 +205,7 @@ static void *client_packet_pump_main(void *data)
if (ret == 0)
ret = -ECANCELED;
free(ptr);
+ ptr = NULL;
break;
}
@@ -206,6 +215,7 @@ static void *client_packet_pump_main(void *data)
if (recv_offset == size) {
packet = packet_build(packet, packet_offset, ptr, size);
free(ptr);
+ ptr = NULL;
if (!packet) {
ret = -EFAULT;
break;