gozfree / gear-lib

Gear-Lib, C library for IOT Embedded Multimedia and Network
MIT License
2.97k stars 805 forks source link

libsock: pointer al is checked for nullness after dereferencing #92

Open szsam opened 1 year ago

szsam commented 1 year ago

In the following code snippet, the pointer al is checked for nullness after is has already been dereferenced. Should we move the check before the dereference?

https://github.com/gozfree/gear-lib/blob/5e1947fd7b86bad1c1ed9d9ce36591585e396793/gear-lib/libsock/libsock.c#L548-L551 https://github.com/gozfree/gear-lib/blob/5e1947fd7b86bad1c1ed9d9ce36591585e396793/gear-lib/libsock/libsock.c#L586-L589