| #include <stdio.h> | |
| #include <stdlib.h> | |
| | |
| int msan(int argc, char* argv[]) | |
| { | |
| char* a = malloc(10 * sizeof(char*)); | |
| Result of 'malloc' is converted to a pointer of type 'char', which is incompatible with sizeof operand type 'char *' | |
| Memory is allocated | |
| Result of 'malloc' is converted to a pointer of type 'char', which is incompatible with sizeof operand type 'char *' | |
| a[5] = 0; | |
| if (a[argc]) | |
| Taking true branch | |
| Assuming the condition is true | |
| printf("xx\n"); | |
| Potential leak of memory pointed to by 'a' | |
| Potential leak of memory pointed to by 'a' | |
| return 0; | |
| } | |