MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / safe_str_free

Function safe_str_free

src/foundation/platform.h:46–51  ·  view source on GitHub ↗

Safe const string free: frees a const char* and NULLs it. * Casts away const so callers don't repeat the (void *) dance. */

Source from the content-addressed store, hash-verified

44/* Safe const string free: frees a const char* and NULLs it.
45 * Casts away const so callers don't repeat the (void *) dance. */
46static inline void safe_str_free(const char **sp) {
47 if (sp && *sp) {
48 free((void *)*sp);
49 *sp = NULL;
50 }
51}
52
53/* Safe buffer free: frees a heap array and zeros its element count.
54 * Use for dynamic arrays paired with a size_t count. */

Callers 15

store_open_internalFunction · 0.85
cbm_store_closeFunction · 0.85
cbm_store_search_freeFunction · 0.85
cbm_store_traverse_freeFunction · 0.85
get_schema_implFunction · 0.85
cbm_store_schema_freeFunction · 0.85
arch_routesFunction · 0.85
arch_layersFunction · 0.85
cluster_build_oneFunction · 0.85
arch_clustersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected