eina_inline: Fixed a potential dangling pointer 44/219844/1
authorJunsuChoi <jsuya.choi@samsung.com>
Wed, 11 Dec 2019 00:27:10 +0000 (09:27 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Wed, 11 Dec 2019 00:28:58 +0000 (09:28 +0900)
Summary: fixed by null handling

Test Plan: N/A

Reviewers: Hermet, YOhoho, cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10850

Change-Id: I4822201dca0b7ad840128c2488e2598a1eb352fc

src/lib/eina/eina_inline_value.x

index a1a6314..8d3457c 100644 (file)
@@ -150,7 +150,11 @@ eina_value_flush(Eina_Value *value)
           }
         else if (type == EINA_VALUE_TYPE_STRING)
           {
-             if (value->value.ptr) free(value->value.ptr);
+             if (value->value.ptr)
+               {
+                  free(value->value.ptr);
+                  value->value.ptr = NULL;
+               }
           }
         else if (type->value_size > 8)
           eina_value_inner_free(type->value_size, mem);