Before I read your code. Valgrind reporting invalid free error is not because of leaked memory, but you try to free invalid memory (or free same memory more than once). Compiling your code with the compilter flag -g (gdb debug), will enable more debug information, making the backtraces from valgrind much better.
A quick guess:
.. for(i = 0; i <= facto-1; i++) { printf("\"%s\"\n", permuts[i]); free (permuts[i]); /* free the text, allocated with strdup(); */ } free(permuts);//free the memory free(stringInput);//free the memory }
Related Posts:
- How to run valgrind with basic c example?
- C free(): invalid pointer
- How do malloc() and free() work?
- Memory Clobbering Error
- Uninitialized value was created by a heap allocation
- Incorrect checksum for freed object on malloc
- Valgrind: invalid read of size 4 -> sigsegv, works fine without valgrind and in visual studio
- Is there a good Valgrind substitute for Windows?
- Compiler Error “void value not ignored as it ought to be” in C programming [duplicate]
- What is a Memory Heap?
- C compiler for Windows?
- Why the range of int is -32768 to 32767?
- Difference between malloc and calloc?
- max value of integer
- How to track down a “double free or corruption” error
- How to track down a “double free or corruption” error
- How do I use valgrind to find memory leaks?
- Invalid read of size 8 – Valgrind + C
- Process finished with exit code 11 | Error during malloc [duplicate]
- Understanding “corrupted size vs. prev_size” glibc error
- Invalid pointer error on invoking free() after malloc in C
- Incompatible implicit declaration of built-in function ‘malloc’
- Need more information about Aborted (core dumped)
- Valgrind: Invalid read of size 1
- When and why to use malloc?
- What is the cause of flexible array member not at end of struct error?
- c array – warning: format not a string literal
- How to properly malloc for array of struct in C
- valgrind – Address —- is 0 bytes after a block of size 8 alloc’d
- difference between
and - malloc: *** error: incorrect checksum for freed object – object was probably modified after being freed
- Use of cudamalloc(). Why the double pointer?
- Allocating string with malloc
- Valgrind complains with “Invalid write of size 8”
- double free or corruption (!prev) error in c program
- Difference between sizeof(char) and sizeof(char *)
- Still Reachable Leak detected by Valgrind
- C’s printf and fprintf(stdout,) are not printing
- error: unknown type name ‘bool’
- Error: “Access not within mapped region at address” (Valgrind)
- Allocating char array using malloc
- Casting a pointer to an int
- How to allocate array of pointers for strings by malloc in C?
- Representing EOF in C code?
- How to display hexadecimal numbers in C?
- Segmentation fault- strcat
- Invalid write of size 1
- realloc(): invalid next size when reallocating to make space for strcat on char *
- Example of realpath function in C
- Error: Conversion to non-scalar type requested
- malloc(sizeof(int)) vs malloc(sizeof(int *)) vs (int *)malloc(sizeof(int))
- How to print a int64_t type in C
- How big can a 64 bit unsigned integer be?
- Using prevNext Modx Addon
- :wq! command in vim
- how to set the background color of the status bar during the launching phase [duplicate]
- api-ms-win-crt-runtime-l1-1-0.dll is missing when opening Microsoft Office file [closed]
- The difference between n++ and ++n at the end of a while loop? (ANSI C)
- What is a segmentation fault?
- How many spaces for tab character(\t)?
- When is K 1024 and when is it 1000?
- What is a MIME type?
- Implementing Taylor Series for sine and cosine in C
- Working on code to calculate cosine with factorial sum
- Logitech/LGHUB Lua – Loop with break
- are there dictionaries in javascript like python?
- How can I convert MP3 file to a Base64 encoded string? [closed]
- Understanding The Modulus Operator %
- Understanding the main method of python [duplicate]
- Dial pad to get phone number (with Android button images)
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- How to use execvp()
- How is the AND/OR operator represented as in Regular Expressions?
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- How to use execvp() to execute a command
- Istio Ingress resulting in “no healthy upstream”
- Why is it not possible to fake an IP address?
- How to open a “-” dashed filename using terminal?
- Substring in excel
- What is a LAMP stack?
- What is a sanity test/check
- What is the difference between POST and PUT in HTTP?
- What is the difference between POST and PUT in HTTP?
- How to find Google’s IP address?
- How does strtok() split the string into tokens in C?
- What exactly is a VBO in OpenGL?
- What and where are the stack and heap?
- ping response “Request timed out.” vs “Destination Host unreachable”
- Authentication versus Authorization
- What is a reverse shell?
- How does npm start work? What all processes are happening in the background?
- What is an instance variable in Java?
- warning: implicit declaration of function
- What is the := operator?
- What is tail recursion?
- warning: implicit declaration of function
- Discord music bot not working
- What does “:=” mean in Pseudocode? [closed]
- Why am I getting error for apple-touch-icon-precomposed.png
- What is *(uint32_t*)?