Patched, loopholes in the assingment operator
authorMinjae Lee <minjae17.lee@samsung.com>
Wed, 20 Mar 2013 11:57:21 +0000 (20:57 +0900)
committerMinjae Lee <minjae17.lee@samsung.com>
Wed, 20 Mar 2013 11:57:21 +0000 (20:57 +0900)
Change-Id: Idcd39862e5edb51433795a9e9632a21ee7f6270d
Signed-off-by: Minjae Lee <minjae17.lee@samsung.com>
src/FTelSimInfo.cpp

index 3c96ed9..039c75d 100644 (file)
@@ -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;