FreeBSD Bugzilla – Attachment 251158 Details for
Bug 279467
mbuf leaks in PF_LOCAL
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
mbuf_leak.c
mbuf_leak.c (text/plain), 1001 bytes, created by
Dmitry Wagin
on 2024-06-02 13:56:48 UTC
(
hide
)
Description:
mbuf_leak.c
Filename:
MIME Type:
Creator:
Dmitry Wagin
Created:
2024-06-02 13:56:48 UTC
Size:
1001 bytes
patch
obsolete
>#include <errno.h> >#include <stdio.h> >#include <stdlib.h> >#include <string.h> >#include <sys/socket.h> >#include <sys/un.h> >#include <syslog.h> >#include <unistd.h> > >int LogFile = -1; > >void >disconnectlog() >{ > if (LogFile != -1) { > close(LogFile); > LogFile=-1; > } >} > >void >connectlog() >{ > struct sockaddr_un SyslogAddr; > > disconnectlog(); > > LogFile = socket(PF_LOCAL, SOCK_DGRAM | SOCK_CLOEXEC, 0); > if (LogFile == -1) { > printf("error socket\n"); > exit(1); > } > > SyslogAddr.sun_len = sizeof(SyslogAddr); > SyslogAddr.sun_family = AF_UNIX; > strncpy(SyslogAddr.sun_path, "/var/run/log", sizeof(SyslogAddr.sun_path)); > if (connect(LogFile, (struct sockaddr *) &SyslogAddr, sizeof(SyslogAddr)) == -1) { > printf("error connect\n"); > exit(1); > } >} > >int >main(int argc, char *argv[]) >{ > ssize_t ret; > > connectlog(); > > for (int i = 0; i < 10000000; i++) { > ret = write(LogFile, "<132>1 2024-05-31T23:36:39.45244+01:00 localhost test 2654 - - test", 66); > if (ret == -1) { > connectlog(); > } > } > exit(0); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 279467
:
251155
| 251158