[Messaging] Return in case of allocation error.
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Mon, 24 Aug 2015 10:52:24 +0000 (12:52 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Mon, 24 Aug 2015 10:52:24 +0000 (12:52 +0200)
Prevent CID: 454028

[Verification] TCT pass rate (r35, email): 100% (308/308/0/0/0).

Change-Id: I0a70bb688c1ab7b63eb9b5b7264522301b9f2ab4
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
src/messaging/messaging_util.cc

index db4a303c422983f704baa18ae7addd1c86785e9a..6cb875dfb58c8eeadea49d95e98de15360f48ed9 100755 (executable)
@@ -337,6 +337,11 @@ std::string PerformConversion(const std::string& input, const gchar* from_charse
 
   outp = dest = static_cast<gchar*>(g_malloc(outbuf_size));
 
+  if (!outp) {
+    LoggerE("Failed to allocate memory.");
+    return input;
+  }
+
   while (!done && !have_error) {
     gsize err = 0;