Safe const string free: frees a const char* and NULLs it. * Casts away const so callers don't repeat the (void *) dance. */
| 44 | /* Safe const string free: frees a const char* and NULLs it. |
| 45 | * Casts away const so callers don't repeat the (void *) dance. */ |
| 46 | static 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. */ |
no outgoing calls
no test coverage detected