Skip to content

Commit

Permalink
fix connection: fix no mem alloc for sa
Browse files Browse the repository at this point in the history
  • Loading branch information
ffashion committed Feb 12, 2024
1 parent 0e5136d commit 5227e47
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/connection/connection.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "xdbd_pool.h"
#include <bfdev/log.h>
#include <bfdev/array.h>
#include <xdbd.h>
Expand All @@ -22,6 +23,11 @@ xdbd_listening_t *xdbd_create_listening(xdbd_t *xdbd, struct sockaddr *sockaddr,

xdbd_memzero(ls, sizeof(xdbd_listening_t));

sa = xdbd_palloc(xdbd->pool, socklen);
if (sa == NULL) {
return NULL;
}

xdbd_memcpy(sa, sockaddr, socklen);

ls->sockaddr = sa;
Expand Down

0 comments on commit 5227e47

Please sign in to comment.