Re: Bug#38529: Memory leak in pointerize (was: Problem #4)
Martin Schulze wrote:
> diff -u -Nur --exclude CVS orig/pointerize-0.2/src/pointerize.c pointerize-0.2/src/pointerize.c
> --- orig/pointerize-0.2/src/pointerize.c Sun Mar 7 21:50:58 1999
> +++ pointerize-0.2/src/pointerize.c Sat May 29 20:49:44 1999
> @@ -956,7 +956,8 @@
> static char *fetchbuffer(void) {
> char *tmp;
> if (pubbuffer) {
> - pubbuffer[pubbufpos]='\0';
> + --pubbufpos;
> + bufferget('\0');
> tmp=strdup(pubbuffer);
> reset_buffer(1);
> return tmp;
>
> This looks ugly but it works.
Although that patch works works, or the following
- bufmax += 100;
+ bufmax += 500;
the result is bullshit.
make[4]: Leaving directory `/usr/src/debian/work/boot-floppies/utilities/dbootstrap/po'
make -C po C.mo
make[4]: Entering directory `/usr/src/debian/work/boot-floppies/utilities/dbootstrap/po'
make[4]: `C.mo' is up to date.
make[4]: Leaving directory `/usr/src/debian/work/boot-floppies/utilities/dbootstrap/po'
cp po/C.mo C.mo
gen-header C.mo
cc -D_GNU_SOURCE -DARCH=i386 -DARCHNAME='"i386"' -DKVER='"2.2.7"' -Wall -g -DINCLUDE_DBOOTSTRAP -c baseconfig.c -o baseconfig.oecho "#line 1 \"bootconfig.c\"" >tmp.bootconfig.c
pointerize -m C.mo <bootconfig.c >>tmp.bootconfig.c
cc -D_GNU_SOURCE -DARCH=i386 -DARCHNAME='"i386"' -DKVER='"2.2.7"' -Wall -g -DINCLUDE_DBOOTSTRAP -o bootconfig.o -c tmp.bootconfig.c
bootconfig.c:1: warning: `/*' within comment
bootconfig.c:9: warning: `/*' within comment
bootconfig.c:11: warning: `/*' within comment
bootconfig.c:11: warning: `/*' within comment
bootconfig.c:11: warning: `/*' within comment
bootconfig.c:11: warning: `/*' within comment
bootconfig.c:11: warning: `/*' within comment
bootconfig.c:13: warning: `/*' within comment
bootconfig.c:13: warning: `/*' within comment
bootconfig.c:13: warning: `/*' within comment
bootconfig.c:13: warning: `/*' within comment
bootconfig.c:13: warning: `/*' within comment
bootconfig.c:13: warning: `/*' within comment
bootconfig.c:13: warning: `/*' within comment
bootconfig.c:13: warning: `/*' within comment
bootconfig.c:13: warning: `/*' within comment
bootconfig.c:13: warning: `/*' within comment
bootconfig.c:15: warning: `/*' within comment
bootconfig.c:15: warning: `/*' within comment
bootconfig.c:1: unterminated comment
make[3]: *** [bootconfig.o] Error 1
make[3]: Leaving directory `/usr/src/debian/work/boot-floppies/utilities/dbootstrap'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/debian/work/boot-floppies/utilities'
make[1]: *** [utils] Error 2
make[1]: Leaving directory `/usr/src/debian/work/boot-floppies'
make: *** [build] Error 2
The file tmp.bootconfig.c looks quite.. umh... interesting...
This is quote. Since I don't know how the file was supposed to look
like I'm unable to fix it. All I can say is that gcc complains about
it for good reason.
----------------------------------------------------------------------
#line 1 "bootconfig.c"
includstrinincludstdiincludfcntincludunistincludsystaincludsyioctincludsymounincludlinufdreincludlinufinclud"../busybox/internal.hinclud"dbootstrap.hinclud"lang.h/* ED: floppy filesystem type is not the same for all architectures *icpsparcppowerpstatichafs_typ"ext2elsstatichafs_typ"msdosendiexterinfdflusconschafilenamexterinmount_onchablockDevicchadirectorchafilesystemTyp unsignelonflagchastring_flaginnoMtainfakicpspardefinUSE_SILelicpm68definUSE_LILOM68elicppowerpdefinUSE_PLILelsdefinUSE_LILendiifde_TESTINGdefinBC_DIR_PREFI"definBC_LILO_CON "etc_lilo.conf_testdefinBC_MB "/boot/mbr.bdefinBC_BOOT_DFL "export LD_LIBRARY_PATH=\"/lib:/usr/lib\"; /sbin/activate %s %sdefinBC_RUN_LIL "export LD_LIBRARY_PATH=\"/lib:/usr/lib\"; /sbin/lilo -r / >/dev/nulldefinBC_SFORMA "/usr/bin/superformatdefinBC_RUN_SFORMA"export LD_LIBRARY_PATH=\"/lib:/usr/lib\"; BC_SFORMA" %s %selsdefinBC_DIR_PREFI"/targetdefinBC_LILO_CON "/target/etc/lilo.confdefinBC_MB "/target/boot/mbr.bdefinBC_BOOT_DFL "export LD_LIBRARY_PATH=\"/target/lib:/target/usr/lib\"; /target/sbin/activate %s %sdefinBC_RUN_LIL "export LD_LIBRARY_PATH=\"/target/lib:/target/usr/lib\"; /target/sbin/lilo -r /target >/dev/nulldefinBC_SILO_CON "/target/etc/silo.confdefinBC_RUN_SIL "export LD_LIBRARY_PATH=\"/target/lib:/target/usr/lib\"; /target/sbin/silo -f -r /target >/dev/nulldefinBC_QUIK_CON "/target/etc/quik.confdefinBC_RUN_QUI "export LD_LIBRARY_PATH=\"/target/lib:/target/usr/lib\"; /target/sbin/quik -f -r /target >/dev/nulldefinBC_VMELILO_CON "/target/etc/vmelilo.confdefinBC_RUN_VMELIL "export LD_LIBRARY_PATH=\"/target/lib:/target/usr/lib\"; /target/sbin/vmelilo -f -w /target >/dev/nulldefinBC_SFORMA "/target/usr/bin/superformatdefinBC_RUN_SFORMA"export LD_LIBRARY_PATH=\"/target/lib:/target/usr/lib\"; BC_SFORMA" %s %sendistatiinwrite_boot_floppchadevic strucstatm FILfile insizstatu inf strucfloppy_strucfloppy_typicpm68 istrcmArch"Amiga problemBo(translation[91](translation[225] retur istrcmArch"VME problemBo(translation[93](translation[225] retur endiicppowerp problemBo(translation[92](translation[225] returendi do_umoundevic do_umoun"/floppyifdeSCSI_FLOPP istrncmdevic"/dev/sfd /* not scsi floppy *endi fdflusdevic /*
* LFG: Given that getfdprm was changed from debian-1.3.1 to debian-2.0
* and that the changes are small, I have decided to include the code in
* here.
*
* This code is taken from getfdprm, fdutils-4.3 by Alain Knaff
* Alain.Knaff@inrialpes.fr
* that released it under GPL.
* fopedevic if fopedevicO_RDONL if retur iioctfFDGETPRfloppy_typ closf retur closf /*
* End of the code taken from getfdprm.c in fdutils.
* sizfloppy_typsiz/* We don't have (yet) 2.88 MB bootable floppy images to use with syslinux * isiz288siz144 istaBC_SFORMAtm boxSuspen printCLEA print(translation[125]/* We don't have (yet) 2.88 MB bootable floppy ... * sprintprtbuBC_RUN_SFORMAdevicsiz72"hd"dd statusysteprtbu boxResum istaturetur pleaseWaitBo(translation[89]icpm68 istrcmArch"Atari sprintprtbu"zcat < %s/usr/lib/atari-bootstrap/img%d%s.gz > %s BC_DIR_PREFIsizArchdevicelicpi38 sprintprtbu"zcat < %s/usr/lib/syslinux/img%dk.gz > %s BC_DIR_PREFIsizdevicelicpspar /* read it from miniroot fs * sprintprtbu"zcat < /usr/lib/dbootstrap/silo%dk.gz > %s sizdevicendi statusysteprtbu boxPopWindo istaturetur imount_ondevic"/floppyfs_typ"\0 retur pleaseWaitBo(translation[80] sprintprtbu"cp %s/vmlinuz /floppy/linuxBC_DIR_PREFI statusysteprtbu istatu boxPopWindoretur syn boxPopWindo pleaseWaitBo(translation[335]icpm68 istrcmArch"Atari ifilefope"/floppy/bootargs"wNUL do_umoun"/floppy boxPopWindo retur fprintfile"-s -k a:\\linux root=%sRoonam fclosfile elicpi38 ifilefope"/floppy/syslinux.cfg"wNUL do_umoun"/floppy boxPopWindo retur fprintfile"DISPLAY message.txt\n fprintfile"TIMEOUT 40\n fprintfile"PROMPT 1\n fprintfile"DEFAULT linux\n fprintfile"APPEND root=%s ro\nRoonam fclosfileelicpspar ifilefope"/floppy/etc/silo.conf"wNUL do_umoun"/floppy boxPopWindo eject_floppdevic retur fprintfile"partition=3\n fprintfile"root=%s\ndevic fprintfile"timeout=100\n fprintfile"image=/linux\n fprintfile"label=linux\n fprintfile"read-only\n fprintfile"append=\"root=%s\"\nRoonam fclosfile /* no need to run silo at this time; the floppy disk is already bootable *endi ifilefope"/floppy/message.txt"wNUL /* FIXME The next message has to be DOS formatted for syslinux. Instead of
----------------------------------------------------------------------
I give up for today. Somebody please hit me with a cluebat - or
somebody else if it is needed.
Regards,
Joey
--
Linux - the choice of a GNU generation
Please always Cc to me when replying to me on the lists.
Reply to: