]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
tools/libxl: Assert that libxl__ao_inprogress_gc() is not called with NULL
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 28 Jul 2015 21:44:37 +0000 (22:44 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 29 Jul 2015 14:25:08 +0000 (15:25 +0100)
libxl__ao_inprogress_gc() is hidden behind various macros used to
construct local variables.  Assert() that NULL is not passed, to make
such an error very obvious, rather than a plain segfault at 0.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_event.c

index 8acecfa544bb216983c2ff4046d3234047441612..bfb6b31a7f99ce827b09b46c21c8c16086be7c61 100644 (file)
@@ -1862,6 +1862,7 @@ void libxl__ao_create_fail(libxl__ao *ao)
 
 libxl__gc *libxl__ao_inprogress_gc(libxl__ao *ao)
 {
+    assert(ao);
     assert(ao->magic == LIBXL__AO_MAGIC);
     assert(!ao->complete);
     return &ao->gc;