...
Code Block | ||
---|---|---|
| ||
size_t size = strlen(input_str)+1; str = (char *) malloc(size); memcpy(str, input_str, size); /* ... */ free(str); str = NULL; |
...
Code Block | ||
---|---|---|
| ||
size_t size = strlen(input_str)+1; str = (char *) malloc(size); if (str == NULL) { /* Handle Allocation Error */ } memcpy(str, input_str, size); /* ... */ free(str); str = NULL; |
...
The LDRA tool suite V 7.6.0 is able to can detect violations of this rule.
Fortify SCA Version 5.0 is able to can detect violations of this rule.
...