[Spice-devel] [PATCH 02/11] syntax-check: fix cast_of_argument_to_free
Uri Lublin
uril at redhat.com
Wed Jul 17 07:04:12 PDT 2013
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
More information about the Spice-devel
mailing list