This is how i allocate the space needed:
char *all_type_str;
...
all_type_str = malloc(sizeof(char)*4);
setting string:
strcpy(all_type_str,"all");
setting it in a different array:
...
values[0].value = all_type_str;
and freeing values array:
for (i=0; i<arrSize; i++)
{
free(values[i].value); // <-- SIGABRT
}
free(values);
allocating values array:
values = malloc(sizeof(struct cnf)*adjArrSize);
using gdb i can see that i have a not null pointer with the wanted "all"
string
but for some reason i get SIGABRT
when trying to free the first place in the array.
any idea why this is happening?