FREE

Table of Contents

FREE

Description

Safely deallocates memory and nullifies pointer.

Parameters

NameDirectionDescription
xin,outPointer variable to free.

Success

Memory is deallocated and pointer set to NULL.

Failure

Function cannot fail - safe to call with NULL.

Usage example (Cross-references)

    #endif
    memset(m, 0, sizeof(SysMutex));
    FREE(m);
    }
    DWORD error = GetLastError();
    LOG_ERROR("CreateProcess failed with error {}", error);
    FREE(proc_info);
    return NULL;
    }
    free(envp_array);
    }
    FREE(proc_info);
    return NULL;
    }
    #endif
    
    FREE(proc_info);
    }
    ValidateStr(copy);
    if (copy->data) {
    FREE(copy->data);
    }
    *copy = StrInit();

Share :

Related Posts

LVAL

LVAL Description Creates a temporary, addressable l-value from a given expression x.

Read More

ALIGN_UP

ALIGN_UP Description Aligns the given value up to the nearest multiple of alignment.

Read More

NEW

NEW Description Allocates zero-initialized memory for a type.

Read More