Skip to content

Commit ac27fcf

Browse files
committed
refactor: remove unnecessary palloc in events.c
1 parent 6521f5b commit ac27fcf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/event.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ int multi_socket_cb(__attribute__ ((unused)) CURL *easy, curl_socket_t sockfd, i
7373
int epoll_op;
7474
if(!socketp){
7575
epoll_op = EPOLL_CTL_ADD;
76-
bool *socket_exists = palloc(sizeof(bool));
77-
curl_multi_assign(wstate->curl_mhandle, sockfd, socket_exists);
76+
bool socket_exists = true;
77+
curl_multi_assign(wstate->curl_mhandle, sockfd, &socket_exists);
7878
} else if (what == CURL_POLL_REMOVE){
7979
epoll_op = EPOLL_CTL_DEL;
80-
pfree(socketp);
81-
curl_multi_assign(wstate->curl_mhandle, sockfd, NULL);
80+
bool socket_exists = false;
81+
curl_multi_assign(wstate->curl_mhandle, sockfd, &socket_exists);
8282
} else {
8383
epoll_op = EPOLL_CTL_MOD;
8484
}

0 commit comments

Comments
 (0)