From: Pawel Andruszkiewicz
Date: Mon, 24 Aug 2015 10:52:24 +0000 (+0200)
Subject: [Messaging] Return in case of allocation error.
X-Git-Tag: submit/tizen/20151026.073646^2^2~172^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=86652c2bba644c1c6bd2d3846136c5f9a807545e;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Messaging] Return in case of allocation error.
Prevent CID: 454028
[Verification] TCT pass rate (r35, email): 100% (308/308/0/0/0).
Change-Id: I0a70bb688c1ab7b63eb9b5b7264522301b9f2ab4
Signed-off-by: Pawel Andruszkiewicz
---
diff --git a/src/messaging/messaging_util.cc b/src/messaging/messaging_util.cc
index db4a303c..6cb875df 100755
--- a/src/messaging/messaging_util.cc
+++ b/src/messaging/messaging_util.cc
@@ -337,6 +337,11 @@ std::string PerformConversion(const std::string& input, const gchar* from_charse
outp = dest = static_cast(g_malloc(outbuf_size));
+ if (!outp) {
+ LoggerE("Failed to allocate memory.");
+ return input;
+ }
+
while (!done && !have_error) {
gsize err = 0;