mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 13:01:59 +00:00
Merge pull request #2437 from pacovn/Coverity_1436343_Dereference_after_null_check
lib: null check (Coverity 1436343)
This commit is contained in:
commit
d17840aa8a
@ -81,7 +81,7 @@ void *qrealloc(struct memtype *mt, void *ptr, size_t size)
|
||||
|
||||
void *qstrdup(struct memtype *mt, const char *str)
|
||||
{
|
||||
return mt_checkalloc(mt, strdup(str), strlen(str) + 1);
|
||||
return str ? mt_checkalloc(mt, strdup(str), strlen(str) + 1) : NULL;
|
||||
}
|
||||
|
||||
void qfree(struct memtype *mt, void *ptr)
|
||||
|
Loading…
Reference in New Issue
Block a user