5 ms·
This "dynamic drop semantics" does not exist in cake. int * owner p = malloc(sizeof(int)); if (condition) free(p); free(p); // error p may
by thradams 3y ago
This "dynamic drop semantics" does not exist in cake.
int * owner p = malloc(sizeof(int));
if (condition)
free(p);
free(p); // error p may be initialized/moved.
to fix
int * owner p = malloc(sizeof(int));
if (condition)
{
free(p);
p = 0;
}
free(p);