mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-03-31 21:40:42 +02:00
os: handle memory allocation failure in get_mcast_options()
Since this is in initial startup, and other errors in this function are already fatal, just make allocation failure of this small structure be fatal as well, since if the X server is already out of memory it will be dying soon anyway. Reported in #1817: xwayland-24.1.6/redhat-linux-build/../os/xdmcp.c:1514:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘mcastinfo’ xwayland-24.1.6/redhat-linux-build/../os/xdmcp.c:1513:25: acquire_memory: this call could return NULL xwayland-24.1.6/redhat-linux-build/../os/xdmcp.c:1514:13: danger: ‘mcastinfo’ could be NULL: unchecked value from (9) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
parent
fde685eefe
commit
f523ddfa3a
1 changed files with 1 additions and 1 deletions
|
|
@ -1518,7 +1518,7 @@ get_mcast_options(int argc, char **argv, int i)
|
|||
else {
|
||||
struct multicastinfo *mcastinfo, *mcl;
|
||||
|
||||
mcastinfo = malloc(sizeof(struct multicastinfo));
|
||||
mcastinfo = XNFalloc(sizeof(struct multicastinfo));
|
||||
mcastinfo->next = NULL;
|
||||
mcastinfo->ai = firstai;
|
||||
mcastinfo->hops = hopcount;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue