[PATCH 02/11] syntax-check: fix cast_of_argument_to_free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In this case, make syntax-check is wrong, and we actually do
need the cast.
A cast is needed when types are   uint64_t <--> pointer

Using a local "ptr" variable makes both gcc and syntax-check happy.
---
 server/tests/test_display_base.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/tests/test_display_base.c b/server/tests/test_display_base.c
index d8ff8d1..20c0e47 100644
--- a/server/tests/test_display_base.c
+++ b/server/tests/test_display_base.c
@@ -42,7 +42,8 @@ static void test_spice_destroy_update(SimpleSpiceUpdate *update)
         return;
     }
     if (update->drawable.clip.type != SPICE_CLIP_TYPE_NONE) {
-        free((uint8_t*)update->drawable.clip.data);
+        uint8_t *ptr = (uint8_t*)update->drawable.clip.data;
+        free(ptr);
     }
     free(update->bitmap);
     free(update);
-- 
1.8.1.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]