diff options
author | Rahul Jain <rahul.jain@samsung.com> | 2020-07-21 16:48:45 +0530 |
---|---|---|
committer | Rahul Jain <rahul.jain@samsung.com> | 2020-07-23 14:50:28 +0530 |
commit | 8f4dbb1aa7ce0b39a12b9cc908a8660c5d61f0cc (patch) | |
tree | e25f9acc773fef9e7838041984249361345fca1d /src/dnsproxy.c | |
parent | f8475e05aab8b64c6779fd4237dceb074b4208d6 (diff) | |
download | connman-submit/tizen/20200730.084504.tar.gz connman-submit/tizen/20200730.084504.tar.bz2 connman-submit/tizen/20200730.084504.zip |
Svace issues: Null check and memory leakssubmit/tizen/20200804.104340submit/tizen/20200730.084504accepted/tizen/unified/20200805.122502
Change-Id: I937af7e6dbe3a919c1d0b0d7dee4b481c2ef0982
Diffstat (limited to 'src/dnsproxy.c')
-rwxr-xr-x | src/dnsproxy.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dnsproxy.c b/src/dnsproxy.c index b244a02e..178e98f7 100755 --- a/src/dnsproxy.c +++ b/src/dnsproxy.c @@ -2177,8 +2177,15 @@ static int forward_dns_reply(unsigned char *reply, int reply_len, int protocol, req->resplen = 0; req->resp = g_try_malloc(reply_len); +#if defined TIZEN_EXT + if (!req->resp) { + g_free(new_reply); + return -ENOMEM; + } +#else if (!req->resp) return -ENOMEM; +#endif memcpy(req->resp, reply, reply_len); req->resplen = reply_len; |