added to check if a variable is null 19/75919/1
authorchanywa <cbible.kim@samsung.com>
Wed, 22 Jun 2016 06:38:56 +0000 (15:38 +0900)
committerchanywa <cbible.kim@samsung.com>
Wed, 22 Jun 2016 06:38:56 +0000 (15:38 +0900)
Change-Id: I48ac5e3b60b78c4b6bb3ab30a66c176d65210f56

src/maps_util.h

index 6fea677..92634cc 100755 (executable)
@@ -127,13 +127,15 @@ public:
        void push_back(const T &value)
        {
                T *clone = new T(value);
-               g_array_append_val(parray, clone);
-               current_size++;
+               if (clone) {
+                       g_array_append_val(parray, clone);
+                       current_size++;
+               }
        }
        T &operator[](size_t idx) const
        {
                T *item = g_array_index(parray, T *, idx);
-                return *item;
+               return *item;
        }
        unsigned int size() const
        {