- 372991: fixed memory leak issue.
- 372995: change a vulnerable function (strerror) to strerror_r.
Change-Id: I2d5e6b815149b30afe0511b831c8d2325abb21b1
Signed-off-by: saerome kim <saerome.kim@samsung.com>
ret = connect(channel->client_sockfd, (struct sockaddr *)&serveraddr, sizeof(serveraddr));
if (ret == -1) {
- _DBG("Connect error : %s", strerror(errno));
+ char buf[128];
+ strerror_r(errno, buf, 128);
+ _DBG("Connect error : %s", buf);
} else {
_DBG("Success Connect to %s", ret_ptr);
}
unsigned char *buf;
buf = (unsigned char *)malloc(1024);
+ if (NULL == buf) {
+ msgp("memory allocation error");
+ return;
+ }
int len;
mdg_channel_read(channel, &buf, &len);
msgp("Get Data : %s, %d", buf, len);
+ free(buf);
+ buf = NULL;
}
static int __request_open_channel(int devidx, int chaidx)