From 86652c2bba644c1c6bd2d3846136c5f9a807545e Mon Sep 17 00:00:00 2001
From: Pawel Andruszkiewicz
Date: Mon, 24 Aug 2015 12:52:24 +0200
Subject: [PATCH] [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
---
src/messaging/messaging_util.cc | 5 +++++
1 file changed, 5 insertions(+)
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;
--
2.34.1