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
- What’s the syntax for mod in java
- What is the difference between ++i and i++?
- STDERR? What is it? What are its common uses?
- Handling file renames in Git
- PermissionError: [Errno 13] in Python
- How to split column into two in R using separate
- What does “1e” mean?
- Getting “conflicting types for function” in C, why?
- how to use uint64_t in C [duplicate]
- Python Key Error=0 – Can’t find Dict error in code
- How do I solve the following errors: “Undefined reference to WinMain”, “[Error] Id returned 1 exit status”?
- Mercurial: no ~/.hgrc file
- error: expected declaration or statement at end of input in c
- Map like structure in C: use int and struct to determine a value
- Why does the arrow (->) operator in C exist?
- Why do I get clang: error: linker command failed with exit code 1?
- Should I learn C before learning C++?
- How to make an array with a dynamic size? General usage of dynamic arrays (maybe pointers too)?
- Operand type clash: int is incompatible with date + The INSERT statement conflicted with the FOREIGN KEY constraint
- Downcasting in Java
- How to printf a memory address in C
- What is the use of intptr_t?
- How do I get monitor resolution in Python?
- Data argument not used by format strings in C
- Receiving “message”:”CB-ACCESS-KEY header is required” when attempting to connect to coinbase pro api
- How does one represent the empty char?
- Removing trailing newline character from fgets() input
- What does “request for member ‘*******’ in something not a structure or union” mean?
- Missing files, DirectX SDK (d3dx9.lib, d3dx9.h)
- gcc: undefined reference to
- Segmentation fault (core dumped) due to fgets – I think
- how to center form using bootstrap 4
- Preventing console window from closing on Visual Studio C/C++ Console application
- What is the proper equivalent of “while(true)” in plain C?
- How to determine why a Greasemonkey script is not running [duplicate]
- How do I compile the asm generated by GCC?
- What is the difference between %g and %f in C?
- youtube iframe api parameter rel=0 doesn’t work
- The difference between char * and char[] [duplicate]
- How to clear input buffer in C?
- What is stdole2.tlb
- Compiler warning – suggest parentheses around assignment used as truth value
- In the following SAS statement, what do the parameters “noobs” and “label” stand for?
- Uploaded successfully to Heroku Local but getting 503 error once pushed to Heroku live
- Access Default Widget's Controls in Customizer Pane
- Using Javascript to Set Redirect Page in Contact Form 7
- Change css for certain user roles
- Block any other domains from using my server