From 90cd6233d8b3e446984ddc1b68b2e89fbf35995d Mon Sep 17 00:00:00 2001 From: Phenom Date: Wed, 19 Apr 2017 14:04:50 +0200 Subject: [PATCH] Fix CAS warnings: Potential leak of memory pointed to by 'toaster' Memory Error: Memory leak: Potential leak of memory pointed to by 'toaster' 1: Memory is allocated in /home/phenom/GIT/RetroShare/trunk/plugins/ VOIP/gui/VOIPToasterNotify.cpp:182 --- plugins/VOIP/gui/VOIPToasterNotify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/VOIP/gui/VOIPToasterNotify.cpp b/plugins/VOIP/gui/VOIPToasterNotify.cpp index d2de3f6bd..eff862467 100644 --- a/plugins/VOIP/gui/VOIPToasterNotify.cpp +++ b/plugins/VOIP/gui/VOIPToasterNotify.cpp @@ -180,7 +180,7 @@ ToasterItem* VOIPToasterNotify::testToasterItem(QString tag) if (tag == "Invitation") toaster = new ToasterItem(new VOIPToasterItem(ownId, tr("Test VOIP Invitation"), VOIPToasterItem::Invitation)); #endif if (tag == "AudioCall") toaster = new ToasterItem(new VOIPToasterItem(ownId, tr("Test VOIP Audio Call"), VOIPToasterItem::AudioCall)); - if (tag == "VideoCall") toaster = new ToasterItem(new VOIPToasterItem(ownId, tr("Test VOIP Video Call"), VOIPToasterItem::VideoCall)); + if (tag == "VideoCall" || toaster == NULL) toaster = new ToasterItem(new VOIPToasterItem(ownId, tr("Test VOIP Video Call"), VOIPToasterItem::VideoCall)); return toaster; }