From: Minjae Lee Date: Wed, 20 Mar 2013 11:57:21 +0000 (+0900) Subject: Patched, loopholes in the assingment operator X-Git-Tag: 2.1b_release~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=d4c14f5f05da740fece658b991c3ed61478c85e2;hp=20e5b4e5c35c36b8c433695151b982b8a3b1dd0b;p=platform%2Fframework%2Fnative%2Ftelephony.git Patched, loopholes in the assingment operator Change-Id: Idcd39862e5edb51433795a9e9632a21ee7f6270d Signed-off-by: Minjae Lee --- diff --git a/src/FTelSimInfo.cpp b/src/FTelSimInfo.cpp index 3c96ed9..039c75d 100644 --- a/src/FTelSimInfo.cpp +++ b/src/FTelSimInfo.cpp @@ -272,7 +272,22 @@ SimInfo::operator =(const SimInfo& rhs) { if (this != &rhs) { - *__pSimInfoImpl = *rhs.__pSimInfoImpl; + if (rhs.__pSimInfoImpl != null) + { + if (__pSimInfoImpl != null) + { + *__pSimInfoImpl = *rhs.__pSimInfoImpl; + } + else + { + __pSimInfoImpl = new (std::nothrow) _SimInfoImpl(*rhs.__pSimInfoImpl); + } + } + else + { + delete __pSimInfoImpl; + __pSimInfoImpl = null; + } } return *this;