otrv4 / libotr-ng

A new implementation of OTR with support for version 4. This is a mirror of https://bugs.otr.im/otrv4/libotr-ng
Other
43 stars 9 forks source link

Build error because of -Werror=null-dereference #144

Closed mytbk closed 6 years ago

mytbk commented 6 years ago

In https://github.com/otrv4/libotr-ng/blob/master/src/list.c#L29 list_new() can return NULL, so there's the following warning:

list.c: In function 'otrng_list_copy':
list.c:99:16: error: potential null pointer dereference [-Werror=null-dereference]
     copy->next = NULL;

The code should check the return value of list_new(), or terminate when malloc fails.

claucece commented 6 years ago

Fixed. Thanks!