My code:
int args_size = 5; char** args; args = (char**) malloc(sizeof(char*) * args_size); // ... args = (char**) realloc(args, sizeof(char*) * (args_size += 5));
I want to increase the size by 5.
But I get this error:
*** glibc detected *** ./a.out: realloc(): invalid next size: 0x0000000000a971c0 ***
I know that a temp variable catching realloc is good, but just for simplicity...