mg(1) does not close DIR on error path

2012-03-24 Thread Igor Zinovik
Hello. mg(1) editor has a small resource leak in make_file_list() function. If it cannot allocate space for `current' list it returns without closing `dirp' with closedir() call. Index: fileio.c === RCS file: /cvs/src/usr.bin

Re: ral(4) diff

2011-03-12 Thread Igor Zinovik
On Mar 10, Tim van der Molen wrote: > I have the following ral(4): > > ral0 at pci0 dev 13 function 0 "Ralink RT2561S" rev 0x00: irq 5, address > 00:1d:7d:49:28:92 > ral0: MAC/BBP RT2561C, RF RT2527 > > After a commit from August 2010 (see > http://marc.info/?l=openbsd-cvs&m=128095139804862) th

[patch] dhcpd memory leak on error path

2010-03-21 Thread Igor Zinovik
Hello, tech@ Follwoing diff plugs memory leak on error path in dhcpd. Index: confpars.c === RCS file: /cvs/src/usr.sbin/dhcpd/confpars.c,v retrieving revision 1.18 diff -u -p -r1.18 confpars.c --- confpars.c 2 Jan 2010 04:2

[patch] lpd(8) memory leak fix

2010-03-21 Thread Igor Zinovik
Hello, tech@ After snprintf(3) call `dir' is no longer needed so free it also on normal code path. Index: info_passwd.c === RCS file: /cvs/src/usr.sbin/amd/amd/info_passwd.c,v retrieving revision 1.7 diff -u -p -r1.7 info_pa

[patch] fix for file descriptor leak in lpd(8)

2010-03-21 Thread Igor Zinovik
Hello, tech@ Do not leak file descriptor `fd' on error path. Index: printjob.c === RCS file: /cvs/src/usr.sbin/lpr/lpd/printjob.c,v retrieving revision 1.45 diff -u -p -r1.45 printjob.c --- printjob.c 27 Oct 2009 23:59:52 -

[patch] small sychronization between OpenCVS and OpenRCS code

2010-03-21 Thread Igor Zinovik
Hello, tech@ This diff synchronizes OpenCVS rcs parser code with OpenRCS. It shrinks code by 3 lines, but does exactly the same thing. It also removes `buf' which becomes redundant for this function. Instead of calling strlcpy(3) three times we can put a line in file with fprintf(3).

[patch] fixes for sendbug

2010-03-21 Thread Igor Zinovik
Hello, tech@ Following diff fixes memory and FILE handle leaks. `acpidir' is allocated via asprintf(3) and `ifp' is opened via popen(3), but not closed. Index: sendbug.c === RCS file: /cvs/src/usr.bin/sendbug/sendbug.c,v r

[patch] file descriptor leak fix

2010-03-21 Thread Igor Zinovik
Hello, tech@ Following diff fixes file descriptor leak `ifd'. Index: diffreg.c === RCS file: /cvs/src/usr.bin/diff/diffreg.c,v retrieving revision 1.73 diff -u -r1.73 diffreg.c --- diffreg.c 27 Oct 2009 23:59:37 -

[patch] memory leak in pfctl_parser

2010-03-20 Thread Igor Zinovik
Hello, tech@ Following diff fixes memory leak. `debug' is allocated via asprintf(3) so we need to free it with free(3). Index: pfctl_parser.c === RCS file: /cvs/src/sbin/pfctl/pfctl_parser.c,v retrieving revision 1.263 diff

Re: Automatic package mirror discovery implementation for pkg_add(1) tool

2010-02-10 Thread Igor Zinovik
PKG_PATH fdm-1.6:tdb-1.0.6p0: ok (1 to go) fdm-1.6: ok Here is the code: /usr/src/usr.sbin/pkg_add/OpenBSD/AutoMirrorDiscovery.pm # ex:ts=8 sw=4: # $OpenBSD$ # # Copyright (c) 2009 Igor Zinovik # # Permission to use, copy, modify, and distribute this software for any # purpose with or without f

[patch] several missing closedir() in libexec/ld.so/ldconfig/ldconfig.c

2010-01-24 Thread Igor Zinovik
Hello, tech@ Index: libexec/ld.so/ldconfig/ldconfig.c === RCS file: /OpenBSD/src/libexec/ld.so/ldconfig/ldconfig.c,v retrieving revision 1.26 diff -u -r1.26 ldconfig.c --- libexec/ld.so/ldconfig/ldconfig.c 19 Aug 2009 19:38:17 -00

[patch] httpd/src/modules/ssl/ssl_util_table.c - fd leak

2010-01-20 Thread Igor Zinovik
Hello. Looks like a file descriptor leak? Index: ssl_util_table.c === RCS file: /OpenBSD/src/usr.sbin/httpd/src/modules/ssl/ssl_util_table.c,v retrieving revision 1.6 diff -u -r1.6 ssl_util_table.c --- ssl_util_table.c2

[patch] arlad/fprio.c file handle leak

2010-01-14 Thread Igor Zinovik
Hello, t...@. Sorry for mangled diff, still have no time to setup my sendmail. BTW where to send patches that fix apache modules, i think that apache 1.3 is no longer maintained? Index: usr.sbin/afs/src/arlad/fprio.c === RCS file:

Re: [patch] patch:util.c does free memory after strdup(3)

2010-01-08 Thread Igor Zinovik
2010/1/8 Stuart Henderson : > On 2010/01/08 13:33, Owain Ainsworth wrote: >> Please note that none of your patches apply because of spaces in the >> whitespace instead of tabs (I applied them manually). Either your mail >> client is mangling the diffs, or you're copy/pasting the diffs into the >> m

[patch] lib/libc/yp/yp_all.c mem leak

2010-01-08 Thread Igor Zinovik
Hello, t...@. A bit tricky code in yp_all.c `val' is not freed. It might be allocated but might be not freed when `key' allocation failed. Index: lib/libc/yp/yp_all.c === RCS file: /OpenBSD/src/lib/libc/yp/yp_all.c,v retrieving re

[patch] dhcpd/confpars.c tiny memory leak

2010-01-08 Thread Igor Zinovik
Hello, t...@. dhcpd forgets to free(3) host. Index: usr.sbin/dhcpd/confpars.c === RCS file: /OpenBSD/src/usr.sbin/dhcpd/confpars.c,v retrieving revision 1.18 diff -u -r1.18 confpars.c --- usr.sbin/dhcpd/confpars.c 2 Jan 2010 04:2

[patch] /usr/src/lib/libc/hash/helper.c

2010-01-08 Thread Igor Zinovik
Hello, t...@. HASHFileChunk leaks file descriptor `fd'. Index: lib/libc/hash/helper.c === RCS file: /OpenBSD/src/lib/libc/hash/helper.c,v retrieving revision 1.8 diff -u -r1.8 helper.c --- lib/libc/hash/helper.c 8 Aug 2005 08:

[patch] patch:util.c does free memory after strdup(3)

2010-01-07 Thread Igor Zinovik
Hello, t...@. tmpbuf is allocated via strdup(3) but it is leaved unfreed when we leave makedirs() function. Index: util.c === RCS file: /OpenBSD/src/usr.bin/patch/util.c,v retrieving revision 1.33 diff -u -r1.33 util.c --- util.c

[patch] pwd_mkdb does closes file descriptors after copy

2010-01-07 Thread Igor Zinovik
Hello, t...@. pwd_mkdb copies one file to another in cp() function. It opens two file descriptors with open(2), but it does not closes them with close(2). Index: pwd_mkdb.c === RCS file: /OpenBSD/src/usr.sbin/pwd_mkdb/pwd_mkdb.c,v

[patch] bgplg.c probably leaks file descriptor

2010-01-07 Thread Igor Zinovik
Hello, t...@. Seems that bgplg.c leaks file descriptor `fd' in lg_incl(). It opens it, but does not closes. Index: bgplg.c === RCS file: /OpenBSD/src/usr.bin/bgplg/bgplg.c,v retrieving revision 1.7 diff -u -r1.7 bgplg.c --- bgplg.c

Automatic package mirror discovery implementation for pkg_add(1) tool

2009-12-05 Thread Igor Zinovik
erlin.de/pub/OpenBSD/ ftp://openbsd.mirror.frontiernet.net/pub/OpenBSD/ ftp://openbsd.mirrors.pair.com/ ftp://openbsd.mirrors.tds.net/pub/OpenBSD/ ftp://openbsd.noc.jgm.gov.ar/pub/OpenBSD/ So here is the code itself (i hope GMail editor wont screw it): #!/usr/bin/perl # ex:ts=8 sw=4: # $OpenBSD$ # Copyright (c)