let cxMapDestroy() ignore NULL as any free()-like function should do

Thu, 07 Nov 2024 20:22:56 +0100

author
Mike Becker <universe@uap-core.de>
date
Thu, 07 Nov 2024 20:22:56 +0100
changeset 984
e8f354a25ac8
parent 983
b040340bf64d
child 985
68754c7de906

let cxMapDestroy() ignore NULL as any free()-like function should do

src/cx/map.h file | annotate | diff | comparison | revisions
--- a/src/cx/map.h	Sun Nov 03 20:15:14 2024 +0100
+++ b/src/cx/map.h	Thu Nov 07 20:22:56 2024 +0100
@@ -204,8 +204,8 @@
  *
  * @param map the map to be destroyed
  */
-__attribute__((__nonnull__))
 static inline void cxMapDestroy(CxMap *map) {
+    if (map == NULL) return;
     map->cl->destructor(map);
 }
 

mercurial