Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes following issue as reported by GCC-10 static analyzer: multipart_parser.c: In function ‘multipart_parser_init’: multipart_parser.c:88:22: error: dereference of possibly-NULL ‘p’ [CWE-690] [-Werror=analyzer-possible-null-dereference] 88 | p->boundary_length = strlen(boundary); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ ‘multipart_parser_init’: events 1-2 | | 83 | multipart_parser* p = malloc(sizeof(multipart_parser) + | | ^~~~~~~~~~~~~~~~ | | | | | (1) this call could return NULL |...... | 88 | p->boundary_length = strlen(boundary); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (2) ‘p’ could be NULL: unchecked value from (1) Signed-off-by: Petr Štetiar <ynezz@true.cz>
- Loading branch information