Memory Ownership in C Explained
The memory ownership problem or pointer ownership problem is a problem generally seen in C and C++ programs. The problem is generally violating a simple assumption that there should be only one pointer to a given piece of memory, so that when the memory is freed, no other pointers will point to an address that has already been freed.
For example, you have a main function, in which a pointer gfcontext_t *ctx to a struct gfcontext_t is created.