]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/mem_pool.h
Cleanup attribute catalog insert errors + cancel SD only once
[bacula/bacula] / bacula / src / lib / mem_pool.h
index b4d2512ba3e282f8894b28d4901b33876f099a94..8926b2f2d3cd8a97da48eedb6320b99ea332db45 100644 (file)
@@ -70,15 +70,8 @@ extern void   free_pool_memory(POOLMEM *buf);
 
 #endif
 
-/* Function to simplify free/reset pointers */
-inline void bfree_and_null(POOLMEM *&a) {
-   if (a) { 
-      free_pool_memory(a);
-      a = NULL;
-   } 
-}
-
-#define free_and_null_pool_memory(a) bfree_and_null((a))
+/* Macro to simplify free/reset pointers */
+#define free_and_null_pool_memory(a) do{if(a){free_pool_memory(a); (a)=NULL;}} while(0)
 
 extern void garbage_collect_memory_pool();
 extern void  close_memory_pool();