drop shared/memory.[ch]

git-svn: trunk@2874
remotes/push_mirror/metadata
Tomasz Kojm 19 years ago
parent 6a4078f256
commit 8ca8a18e2d
  1. 4
      ChangeLog
  2. 2
      clamav-milter/Makefile.am
  3. 21
      clamav-milter/Makefile.in
  4. 4
      clamconf/Makefile.am
  5. 23
      clamconf/Makefile.in
  6. 4
      clamd/Makefile.am
  7. 35
      clamd/Makefile.in
  8. 1
      clamd/clamd.c
  9. 18
      clamd/others.c
  10. 5
      clamd/scanner.c
  11. 7
      clamd/server-th.c
  12. 3
      clamd/session.c
  13. 7
      clamd/thrmgr.c
  14. 2
      clamdscan/Makefile.am
  15. 27
      clamdscan/Makefile.in
  16. 9
      clamdscan/client.c
  17. 4
      clamscan/Makefile.am
  18. 25
      clamscan/Makefile.in
  19. 13
      clamscan/manager.c
  20. 9
      clamscan/treewalk.c
  21. 2
      freshclam/Makefile.am
  22. 25
      freshclam/Makefile.in
  23. 6
      freshclam/dns.c
  24. 13
      freshclam/manager.c
  25. 11
      shared/cdiff.c
  26. 7
      shared/cfgparser.c
  27. 49
      shared/memory.c
  28. 28
      shared/memory.h
  29. 7
      shared/misc.c
  30. 21
      shared/options.c
  31. 3
      shared/output.c
  32. 4
      sigtool/Makefile.am
  33. 24
      sigtool/Makefile.in
  34. 10
      sigtool/sigtool.c

@ -1,3 +1,7 @@
Wed Feb 28 01:48:27 CET 2007 (tk)
---------------------------------
* drop shared/memory.[ch]
Wed Feb 28 01:14:19 CET 2007 (tk)
---------------------------------
* libclamav: minor cleanup (bb#247)

@ -29,8 +29,6 @@ clamav_milter_SOURCES = \
$(top_srcdir)/shared/output.h \
$(top_srcdir)/shared/getopt.c \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/misc.h \
$(top_srcdir)/shared/network.c \

@ -73,15 +73,13 @@ PROGRAMS = $(sbin_PROGRAMS)
am__clamav_milter_SOURCES_DIST = $(top_srcdir)/shared/cfgparser.c \
$(top_srcdir)/shared/cfgparser.h $(top_srcdir)/shared/output.c \
$(top_srcdir)/shared/output.h $(top_srcdir)/shared/getopt.c \
$(top_srcdir)/shared/getopt.h $(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h $(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/getopt.h $(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/misc.h $(top_srcdir)/shared/network.c \
$(top_srcdir)/shared/network.h clamav-milter.c
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@am_clamav_milter_OBJECTS = \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ cfgparser.$(OBJEXT) \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ output.$(OBJEXT) \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ getopt.$(OBJEXT) \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ memory.$(OBJEXT) \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ misc.$(OBJEXT) \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ network.$(OBJEXT) \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ clamav-milter.$(OBJEXT)
@ -238,8 +236,6 @@ target_vendor = @target_vendor@
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/output.h \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/getopt.c \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/getopt.h \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/memory.c \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/memory.h \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/misc.c \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/misc.h \
@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@ $(top_srcdir)/shared/network.c \
@ -323,7 +319,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfgparser.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamav-milter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/network.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
@ -391,20 +386,6 @@ getopt.obj: $(top_srcdir)/shared/getopt.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt.obj `if test -f '$(top_srcdir)/shared/getopt.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/getopt.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/getopt.c'; fi`
memory.o: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.o -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
memory.obj: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.obj -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`
misc.o: $(top_srcdir)/shared/misc.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.o -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi

@ -1,5 +1,5 @@
#
# Copyright (C) 2006 Tomasz Kojm <tkojm@clamav.net>
# Copyright (C) 2006 - 2007 Tomasz Kojm <tkojm@clamav.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -21,8 +21,6 @@ bin_PROGRAMS = clamconf
clamconf_SOURCES = \
$(top_srcdir)/shared/cfgparser.c \
$(top_srcdir)/shared/cfgparser.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/misc.h \
$(top_srcdir)/shared/getopt.c \

@ -15,7 +15,7 @@
@SET_MAKE@
#
# Copyright (C) 2006 Tomasz Kojm <tkojm@clamav.net>
# Copyright (C) 2006 - 2007 Tomasz Kojm <tkojm@clamav.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -69,8 +69,8 @@ CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_clamconf_OBJECTS = cfgparser.$(OBJEXT) memory.$(OBJEXT) \
misc.$(OBJEXT) getopt.$(OBJEXT) clamconf.$(OBJEXT)
am_clamconf_OBJECTS = cfgparser.$(OBJEXT) misc.$(OBJEXT) \
getopt.$(OBJEXT) clamconf.$(OBJEXT)
clamconf_OBJECTS = $(am_clamconf_OBJECTS)
clamconf_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
@ -217,8 +217,6 @@ target_vendor = @target_vendor@
clamconf_SOURCES = \
$(top_srcdir)/shared/cfgparser.c \
$(top_srcdir)/shared/cfgparser.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/misc.h \
$(top_srcdir)/shared/getopt.c \
@ -300,7 +298,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfgparser.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamconf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
.c.o:
@ -338,20 +335,6 @@ cfgparser.obj: $(top_srcdir)/shared/cfgparser.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cfgparser.obj `if test -f '$(top_srcdir)/shared/cfgparser.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/cfgparser.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/cfgparser.c'; fi`
memory.o: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.o -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
memory.obj: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.obj -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`
misc.o: $(top_srcdir)/shared/misc.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.o -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi

@ -1,5 +1,5 @@
#
# Copyright (C) 2002 - 2006 Tomasz Kojm <tkojm@clamav.net>
# Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -27,8 +27,6 @@ clamd_SOURCES = \
$(top_srcdir)/shared/cfgparser.h \
$(top_srcdir)/shared/getopt.c \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/misc.h \
$(top_srcdir)/shared/network.c \

@ -15,7 +15,7 @@
@SET_MAKE@
#
# Copyright (C) 2002 - 2006 Tomasz Kojm <tkojm@clamav.net>
# Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -72,8 +72,7 @@ PROGRAMS = $(sbin_PROGRAMS)
am__clamd_SOURCES_DIST = $(top_srcdir)/shared/output.c \
$(top_srcdir)/shared/output.h $(top_srcdir)/shared/cfgparser.c \
$(top_srcdir)/shared/cfgparser.h $(top_srcdir)/shared/getopt.c \
$(top_srcdir)/shared/getopt.h $(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h $(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/getopt.h $(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/misc.h $(top_srcdir)/shared/network.c \
$(top_srcdir)/shared/network.h $(top_srcdir)/shared/options.c \
$(top_srcdir)/shared/options.h clamd.c tcpserver.c tcpserver.h \
@ -84,13 +83,12 @@ am__clamd_SOURCES_DIST = $(top_srcdir)/shared/output.c \
dazukoio_xp.h shared.h
@BUILD_CLAMD_TRUE@am_clamd_OBJECTS = output.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ cfgparser.$(OBJEXT) getopt.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ memory.$(OBJEXT) misc.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ network.$(OBJEXT) options.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ clamd.$(OBJEXT) tcpserver.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ localserver.$(OBJEXT) session.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ thrmgr.$(OBJEXT) server-th.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ scanner.$(OBJEXT) others.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ clamuko.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ misc.$(OBJEXT) network.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ options.$(OBJEXT) clamd.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ tcpserver.$(OBJEXT) localserver.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ session.$(OBJEXT) thrmgr.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ server-th.$(OBJEXT) scanner.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ others.$(OBJEXT) clamuko.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ dazukoio_compat12.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ dazukoio.$(OBJEXT)
clamd_OBJECTS = $(am_clamd_OBJECTS)
@ -243,8 +241,6 @@ target_vendor = @target_vendor@
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/cfgparser.h \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/getopt.c \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/getopt.h \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/memory.c \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/memory.h \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/misc.c \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/misc.h \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/network.c \
@ -355,7 +351,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dazukoio_compat12.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localserver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/network.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
@ -430,20 +425,6 @@ getopt.obj: $(top_srcdir)/shared/getopt.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt.obj `if test -f '$(top_srcdir)/shared/getopt.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/getopt.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/getopt.c'; fi`
memory.o: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.o -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
memory.obj: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.obj -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`
misc.o: $(top_srcdir)/shared/misc.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.o -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi

@ -54,7 +54,6 @@
#include "libclamav/clamav.h"
#include "libclamav/others.h"
#include "shared/memory.h"
#include "shared/output.h"
#include "shared/options.h"
#include "shared/cfgparser.h"

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002 - 2005 Tomasz Kojm <tkojm@clamav.net>
* Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -77,7 +77,6 @@
#endif /* HAVE_POLL_H */
#endif /* HAVE_POLL */
#include "shared/memory.h"
#include "shared/cfgparser.h"
#include "shared/output.h"
@ -115,7 +114,7 @@ void virusaction(const char *filename, const char *virname, const struct cfgstru
cmd = strdup(cpt->strarg);
if((pt = strstr(cmd, "%v"))) {
buffer = (char *) mcalloc(strlen(cmd) + strlen(virname) + 10, sizeof(char));
buffer = (char *) malloc(strlen(cmd) + strlen(virname) + 10);
*pt = 0; pt += 2;
strcpy(buffer, cmd);
strcat(buffer, virname);
@ -124,20 +123,19 @@ void virusaction(const char *filename, const char *virname, const struct cfgstru
cmd = strdup(buffer);
free(buffer);
}
/* Allocate env vars.. to be portable env vars should not be freed */
buffer = (char *) mcalloc(strlen(ENV_FILE) + strlen(filename) + 2, sizeof(char));
buffer = (char *) malloc(strlen(ENV_FILE) + strlen(filename) + 2);
sprintf(buffer, "%s=%s", ENV_FILE, filename);
putenv(buffer);
buffer = (char *) mcalloc(strlen(ENV_VIRUS) + strlen(virname) + 2, sizeof(char));
buffer = (char *) malloc(strlen(ENV_VIRUS) + strlen(virname) + 2);
sprintf(buffer, "%s=%s", ENV_VIRUS, virname);
putenv(buffer);
/* WARNING: this is uninterruptable ! */
exit(system(cmd));
/* The below is not reached but is here for completeness to remind
maintainers that this buffer is still allocated.. */
free(cmd);
@ -160,7 +158,7 @@ int poll_fds(int *fds, int nfds, int timeout_sec, int check_signals)
struct pollfd *poll_data = poll_1;
if (nfds>1) {
poll_data = mmalloc(nfds*sizeof(*poll_data));
poll_data = malloc(nfds*sizeof(*poll_data));
if(!poll_data) {
logg("!poll_fds: Can't allocate memory for poll_data\n");
return -1;

@ -56,7 +56,6 @@
#include "libclamav/others.h"
#include "shared/cfgparser.h"
#include "shared/memory.h"
#include "shared/output.h"
#include "shared/misc.h"
@ -152,7 +151,7 @@ static int dirscan(const char *dirname, const char **virname, unsigned long int
{
if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) {
/* build the full name */
fname = (char *) mcalloc(strlen(dirname) + strlen(dent->d_name) + 2, sizeof(char));
fname = (char *) malloc(strlen(dirname) + strlen(dent->d_name) + 2);
if(!fname) {
logg("!Can't allocate memory for fname\n");
closedir(dd);
@ -180,7 +179,7 @@ static int dirscan(const char *dirname, const char **virname, unsigned long int
{
if(type == TYPE_MULTISCAN) {
scandata = (struct multi_tag *) mmalloc(sizeof(struct multi_tag));
scandata = (struct multi_tag *) malloc(sizeof(struct multi_tag));
if(!scandata) {
logg("!Can't allocate memory for scandata\n");
free(fname);

@ -42,7 +42,6 @@
#include "libclamav/clamav.h"
#include "shared/memory.h"
#include "shared/output.h"
#include "server.h"
@ -210,7 +209,7 @@ static struct cl_engine *reload_db(struct cl_engine *engine, unsigned int dbopti
logg("Reading databases from %s\n", dbdir);
if(dbstat == NULL) {
dbstat = (struct cl_stat *) mmalloc(sizeof(struct cl_stat));
dbstat = (struct cl_stat *) malloc(sizeof(struct cl_stat));
if(!dbstat) {
logg("!Can't allocate memory for dbstat\n");
*ret = 1;
@ -467,7 +466,7 @@ int acceptloop_th(int *socketds, int nsockets, struct cl_engine *engine, unsigne
pthread_attr_init(&clamuko_attr);
pthread_attr_setdetachstate(&clamuko_attr, PTHREAD_CREATE_JOINABLE);
tharg = (struct thrarg *) mmalloc(sizeof(struct thrarg));
tharg = (struct thrarg *) malloc(sizeof(struct thrarg));
tharg->copt = copt;
tharg->engine = engine;
tharg->limits = &limits;
@ -573,7 +572,7 @@ int acceptloop_th(int *socketds, int nsockets, struct cl_engine *engine, unsigne
}
if (!progexit && new_sd >= 0) {
client_conn = (client_conn_t *) mmalloc(sizeof(struct client_conn_tag));
client_conn = (client_conn_t *) malloc(sizeof(struct client_conn_tag));
client_conn->sd = new_sd;
client_conn->options = options;
client_conn->copt = copt;

@ -46,7 +46,6 @@
#include "libclamav/str.h"
#include "shared/cfgparser.h"
#include "shared/memory.h"
#include "shared/output.h"
#include "shared/misc.h"
@ -110,7 +109,7 @@ int command(int desc, const struct cl_engine *engine, const struct cl_limits *li
struct stat foo;
if(!(path = mmalloc(strlen(dbdir) + 30))) {
if(!(path = malloc(strlen(dbdir) + 30))) {
mdprintf(desc, "Memory allocation error - SHUTDOWN forced\n");
return COMMAND_SHUTDOWN;
}

@ -26,7 +26,6 @@
#include <time.h>
#include <errno.h>
#include "shared/memory.h"
#include "shared/output.h"
#include "thrmgr.h"
@ -39,7 +38,7 @@ static work_queue_t *work_queue_new(void)
{
work_queue_t *work_q;
work_q = (work_queue_t *) mmalloc(sizeof(work_queue_t));
work_q = (work_queue_t *) malloc(sizeof(work_queue_t));
if (!work_q) {
return NULL;
}
@ -56,7 +55,7 @@ static int work_queue_add(work_queue_t *work_q, void *data)
if (!work_q) {
return FALSE;
}
work_item = (work_item_t *) mmalloc(sizeof(work_item_t));
work_item = (work_item_t *) malloc(sizeof(work_item_t));
if (!work_item) {
return FALSE;
}
@ -142,7 +141,7 @@ threadpool_t *thrmgr_new(int max_threads, int idle_timeout, void (*handler)(void
return NULL;
}
threadpool = (threadpool_t *) mmalloc(sizeof(threadpool_t));
threadpool = (threadpool_t *) malloc(sizeof(threadpool_t));
if (!threadpool) {
return NULL;
}

@ -25,8 +25,6 @@ clamdscan_SOURCES = \
$(top_srcdir)/shared/output.h \
$(top_srcdir)/shared/cfgparser.c \
$(top_srcdir)/shared/cfgparser.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/misc.h \
$(top_srcdir)/shared/getopt.c \

@ -71,17 +71,15 @@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am__clamdscan_SOURCES_DIST = $(top_srcdir)/shared/output.c \
$(top_srcdir)/shared/output.h $(top_srcdir)/shared/cfgparser.c \
$(top_srcdir)/shared/cfgparser.h $(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h $(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/cfgparser.h $(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/misc.h $(top_srcdir)/shared/getopt.c \
$(top_srcdir)/shared/getopt.h $(top_srcdir)/shared/options.c \
$(top_srcdir)/shared/options.h clamdscan.c client.c client.h \
defaults.h
@BUILD_CLAMD_TRUE@am_clamdscan_OBJECTS = output.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ cfgparser.$(OBJEXT) memory.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ misc.$(OBJEXT) getopt.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ options.$(OBJEXT) clamdscan.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ client.$(OBJEXT)
@BUILD_CLAMD_TRUE@ cfgparser.$(OBJEXT) misc.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ getopt.$(OBJEXT) options.$(OBJEXT) \
@BUILD_CLAMD_TRUE@ clamdscan.$(OBJEXT) client.$(OBJEXT)
clamdscan_OBJECTS = $(am_clamdscan_OBJECTS)
clamdscan_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
@ -230,8 +228,6 @@ target_vendor = @target_vendor@
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/output.h \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/cfgparser.c \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/cfgparser.h \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/memory.c \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/memory.h \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/misc.c \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/misc.h \
@BUILD_CLAMD_TRUE@ $(top_srcdir)/shared/getopt.c \
@ -319,7 +315,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamdscan.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
@ -373,20 +368,6 @@ cfgparser.obj: $(top_srcdir)/shared/cfgparser.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cfgparser.obj `if test -f '$(top_srcdir)/shared/cfgparser.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/cfgparser.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/cfgparser.c'; fi`
memory.o: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.o -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
memory.obj: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.obj -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`
misc.o: $(top_srcdir)/shared/misc.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.o -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002 - 2006 Tomasz Kojm <tkojm@clamav.net>
* Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -42,7 +42,6 @@
#include "defaults.h"
#include "options.h"
#include "cfgparser.h"
#include "memory.h"
#include "output.h"
#include "misc.h"
#include "str.h"
@ -125,7 +124,7 @@ static int dsfile(int sockd, const char *scantype, const char *filename, const s
char *scancmd;
scancmd = mcalloc(strlen(filename) + 20, sizeof(char));
scancmd = malloc(strlen(filename) + 20);
sprintf(scancmd, "%s %s", scantype, filename);
if(write(sockd, scancmd, strlen(scancmd)) <= 0) {
@ -295,7 +294,7 @@ static char *abpath(const char *filename)
perror(filename);
return NULL;
} else {
fullpath = mcalloc(200 + strlen(filename) + 10, sizeof(char));
fullpath = malloc(200 + strlen(filename) + 10);
#ifdef C_CYGWIN
sprintf(fullpath, "%s", filename);
#else
@ -539,7 +538,7 @@ void move_infected(const char *filename, const struct optstruct *opt)
movefilename_size = sizeof(char) * (strlen(movedir) + strlen(tmp) + sizeof(numext) + 2);
if(!(movefilename = mmalloc(movefilename_size))) {
if(!(movefilename = malloc(movefilename_size))) {
logg("^Memory allocation error\n");
exit(2);
}

@ -1,5 +1,5 @@
#
# Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net>
# Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
# Fixes by Arkadiusz Miskiewicz <misiek@pld.org.pl>
#
# This program is free software; you can redistribute it and/or modify
@ -24,8 +24,6 @@ clamscan_SOURCES = \
$(top_srcdir)/shared/output.h \
$(top_srcdir)/shared/getopt.c \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/cfgparser.c \
$(top_srcdir)/shared/cfgparser.h \
$(top_srcdir)/shared/misc.c \

@ -15,7 +15,7 @@
@SET_MAKE@
#
# Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net>
# Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
# Fixes by Arkadiusz Miskiewicz <misiek@pld.org.pl>
#
# This program is free software; you can redistribute it and/or modify
@ -71,9 +71,9 @@ am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_clamscan_OBJECTS = output.$(OBJEXT) getopt.$(OBJEXT) \
memory.$(OBJEXT) cfgparser.$(OBJEXT) misc.$(OBJEXT) \
options.$(OBJEXT) clamscan.$(OBJEXT) others.$(OBJEXT) \
manager.$(OBJEXT) treewalk.$(OBJEXT)
cfgparser.$(OBJEXT) misc.$(OBJEXT) options.$(OBJEXT) \
clamscan.$(OBJEXT) others.$(OBJEXT) manager.$(OBJEXT) \
treewalk.$(OBJEXT)
clamscan_OBJECTS = $(am_clamscan_OBJECTS)
clamscan_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
@ -222,8 +222,6 @@ clamscan_SOURCES = \
$(top_srcdir)/shared/output.h \
$(top_srcdir)/shared/getopt.c \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/cfgparser.c \
$(top_srcdir)/shared/cfgparser.h \
$(top_srcdir)/shared/misc.c \
@ -316,7 +314,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamscan.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manager.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/others.Po@am__quote@
@ -372,20 +369,6 @@ getopt.obj: $(top_srcdir)/shared/getopt.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt.obj `if test -f '$(top_srcdir)/shared/getopt.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/getopt.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/getopt.c'; fi`
memory.o: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.o -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
memory.obj: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.obj -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`
cfgparser.o: $(top_srcdir)/shared/cfgparser.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cfgparser.o -MD -MP -MF "$(DEPDIR)/cfgparser.Tpo" -c -o cfgparser.o `test -f '$(top_srcdir)/shared/cfgparser.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/cfgparser.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cfgparser.Tpo" "$(DEPDIR)/cfgparser.Po"; else rm -f "$(DEPDIR)/cfgparser.Tpo"; exit 1; fi

@ -55,7 +55,6 @@
#include "global.h"
#include "shared/options.h"
#include "shared/memory.h"
#include "shared/output.h"
#include "shared/misc.h"
@ -229,7 +228,7 @@ int scanmanager(const struct optstruct *opt)
char *cpy, *ptr;
ptr = opt_arg(opt, "max-space");
if(tolower(ptr[strlen(ptr) - 1]) == 'm') {
cpy = mcalloc(strlen(ptr), sizeof(char));
cpy = malloc(strlen(ptr));
strncpy(cpy, ptr, strlen(ptr) - 1);
limits.maxfilesize = atoi(cpy) * 1024 * 1024;
free(cpy);
@ -356,7 +355,7 @@ int scanmanager(const struct optstruct *opt)
logg("!Can't get absolute pathname of current working directory\n");
return 57;
} else {
fullpath = mcalloc(512, sizeof(char));
fullpath = malloc(512);
#ifdef NO_SNPRINTF
sprintf(fullpath, "%s/%s", cwd, thefilename);
#else
@ -434,7 +433,7 @@ static int clamav_unpack(const char *prog, char **args, const char *tmpdir, cons
char *cpy, *ptr;
ptr = opt_arg(opt, "max-space");
if(tolower(ptr[strlen(ptr) - 1]) == 'm') { /* megabytes */
cpy = mcalloc(strlen(ptr), sizeof(char));
cpy = malloc(strlen(ptr));
strncpy(cpy, ptr, strlen(ptr) - 1);
maxspace = atoi(cpy) * 1024;
free(cpy);
@ -554,8 +553,8 @@ static void move_infected(const char *filename, const struct optstruct *opt)
movefilename_size = sizeof(char) * (strlen(movedir) + strlen(tmp) + sizeof(numext) + 2);
if(!(movefilename = mmalloc(movefilename_size))) {
logg("!mmalloc() failed\n");
if(!(movefilename = malloc(movefilename_size))) {
logg("!malloc() failed\n");
exit(71);
}
@ -900,7 +899,7 @@ static int scandenied(const char *filename, struct cl_engine *engine, const stru
exit(63); /* critical */
}
tmpfile = (char *) mcalloc(strlen(gendir) + strlen(filename) + 10, sizeof(char));
tmpfile = (char *) malloc(strlen(gendir) + strlen(filename) + 10);
pt = strrchr(filename, '/');
if(!pt)
pt = (char *) filename;

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002 - 2005 Tomasz Kojm <tkojm@clamav.net>
* Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -49,7 +49,6 @@
#include "treewalk.h"
#include "shared/options.h"
#include "shared/memory.h"
#include "shared/output.h"
#include "shared/misc.h"
@ -116,7 +115,7 @@ int treewalk(const char *dirname, struct cl_engine *engine, const struct passwd
{
if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) {
/* build the full name */
fname = mcalloc(strlen(dirname) + strlen(dent->d_name) + 2, sizeof(char));
fname = malloc(strlen(dirname) + strlen(dent->d_name) + 2);
sprintf(fname, "%s/%s", dirname, dent->d_name);
/* stat the file */
@ -220,7 +219,7 @@ int fixperms(const char *dirname)
{
if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) {
/* build full name */
fname = mcalloc(strlen(dirname) + strlen(dent->d_name) + 2, sizeof(char));
fname = malloc(strlen(dirname) + strlen(dent->d_name) + 2);
sprintf(fname, "%s/%s", dirname, dent->d_name);
/* stat the file */
@ -268,7 +267,7 @@ int du(const char *dirname, struct s_du *n)
n->files++;
/* build the full name */
fname = mcalloc(strlen(dirname) + strlen(dent->d_name) + 2, sizeof(char));
fname = malloc(strlen(dirname) + strlen(dent->d_name) + 2);
sprintf(fname, "%s/%s", dirname, dent->d_name);
/* stat the file */

@ -26,8 +26,6 @@ freshclam_SOURCES = \
$(top_srcdir)/shared/cfgparser.h \
$(top_srcdir)/shared/getopt.c \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/misc.h \
$(top_srcdir)/shared/options.c \

@ -71,10 +71,10 @@ am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_freshclam_OBJECTS = output.$(OBJEXT) cfgparser.$(OBJEXT) \
getopt.$(OBJEXT) memory.$(OBJEXT) misc.$(OBJEXT) \
options.$(OBJEXT) cdiff.$(OBJEXT) freshclam.$(OBJEXT) \
manager.$(OBJEXT) notify.$(OBJEXT) dns.$(OBJEXT) \
execute.$(OBJEXT) nonblock.$(OBJEXT) mirman.$(OBJEXT)
getopt.$(OBJEXT) misc.$(OBJEXT) options.$(OBJEXT) \
cdiff.$(OBJEXT) freshclam.$(OBJEXT) manager.$(OBJEXT) \
notify.$(OBJEXT) dns.$(OBJEXT) execute.$(OBJEXT) \
nonblock.$(OBJEXT) mirman.$(OBJEXT)
freshclam_OBJECTS = $(am_freshclam_OBJECTS)
freshclam_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
@ -225,8 +225,6 @@ freshclam_SOURCES = \
$(top_srcdir)/shared/cfgparser.h \
$(top_srcdir)/shared/getopt.c \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/misc.c \
$(top_srcdir)/shared/misc.h \
$(top_srcdir)/shared/options.c \
@ -326,7 +324,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freshclam.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manager.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mirman.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nonblock.Po@am__quote@
@ -397,20 +394,6 @@ getopt.obj: $(top_srcdir)/shared/getopt.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt.obj `if test -f '$(top_srcdir)/shared/getopt.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/getopt.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/getopt.c'; fi`
memory.o: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.o -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
memory.obj: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.obj -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`
misc.o: $(top_srcdir)/shared/misc.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.o -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi

@ -35,7 +35,6 @@
#include <resolv.h>
#include <sys/types.h>
#include "shared/memory.h"
#include "shared/output.h"
#include "dns.h"
@ -118,7 +117,7 @@ char *txtquery(const char *domain, unsigned int *ttl)
return NULL;
}
if(!(txt = mmalloc(txtlen + 1)))
if(!(txt = malloc(txtlen + 1)))
return NULL;
pt++;
@ -140,7 +139,6 @@ char *txtquery(const char *domain, unsigned int *ttl)
#include <string.h>
#include <windows.h>
#include <windns.h>
#include "shared/memory.h"
#include "shared/output.h"
char *txtquery(const char *domain, unsigned int *ttl)
@ -155,7 +153,7 @@ char *txtquery(const char *domain, unsigned int *ttl)
return NULL;
if((pDnsRecord->Data.TXT.dwStringCount > 0) && pDnsRecord->Data.TXT.pStringArray[0]) {
txt = mmalloc(strlen(pDnsRecord->Data.TXT.pStringArray[0]) + 1);
txt = malloc(strlen(pDnsRecord->Data.TXT.pStringArray[0]) + 1);
if(txt)
strcpy(txt, pDnsRecord->Data.TXT.pStringArray[0]);
*ttl = pDnsRecord->dwTtl;

@ -62,7 +62,6 @@
#include "shared/cfgparser.h"
#include "shared/output.h"
#include "shared/misc.h"
#include "shared/memory.h"
#include "shared/cdiff.h"
#include "libclamav/clamav.h"
@ -284,14 +283,14 @@ static char *proxyauth(const char *user, const char *pass)
char *buf, *userpass, *auth;
userpass = mmalloc(strlen(user) + strlen(pass) + 2);
userpass = malloc(strlen(user) + strlen(pass) + 2);
if(!userpass) {
logg("!proxyauth: Can't allocate memory for 'userpass'\n");
return NULL;
}
sprintf(userpass, "%s:%s", user, pass);
buf = mmalloc((strlen(pass) + strlen(user)) * 2 + 4);
buf = malloc((strlen(pass) + strlen(user)) * 2 + 4);
if(!buf) {
logg("!proxyauth: Can't allocate memory for 'buf'\n");
free(userpass);
@ -301,7 +300,7 @@ static char *proxyauth(const char *user, const char *pass)
len = fmt_base64(buf, userpass, strlen(userpass));
free(userpass);
buf[len] = '\0';
auth = mmalloc(strlen(buf) + 30);
auth = malloc(strlen(buf) + 30);
if(!auth) {
logg("!proxyauth: Can't allocate memory for 'authorization'\n");
return NULL;
@ -326,7 +325,7 @@ static struct cl_cvd *remote_cvdhead(const char *file, const char *hostname, cha
if(proxy) {
remotename = mmalloc(strlen(hostname) + 8);
remotename = malloc(strlen(hostname) + 8);
if(!remotename) {
logg("!remote_cvdhead: Can't allocate memory for 'remotename'\n");
return NULL;
@ -491,7 +490,7 @@ static int getfile(const char *srcfile, const char *destfile, const char *hostna
if(proxy) {
remotename = mmalloc(strlen(hostname) + 8);
remotename = malloc(strlen(hostname) + 8);
if(!remotename) {
logg("!getfile: Can't allocate memory for 'remotename'\n");
return 75; /* FIXME */
@ -1229,7 +1228,7 @@ int downloadmanager(const struct cfgstruct *copt, const struct optstruct *opt, c
char *cmd = strdup(arg);
if((pt = strstr(cmd, "%v")) && newver && isdigit(*newver)) {
char *buffer = (char *) mcalloc(strlen(cmd) + strlen(newver) + 10, sizeof(char));
char *buffer = (char *) malloc(strlen(cmd) + strlen(newver) + 10);
if(!buffer) {
logg("!downloadmanager: Can't allocate memory for buffer\n");

@ -1,5 +1,5 @@
/*
* Copyright (C) 2006 Tomasz Kojm <tkojm@clamav.net>
* Copyright (C) 2006 - 2007 Tomasz Kojm <tkojm@clamav.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -29,7 +29,6 @@
#include <sys/stat.h>
#include <unistd.h>
#include "shared/memory.h"
#include "shared/misc.h"
#include "shared/output.h"
#include "shared/cdiff.h"
@ -154,7 +153,7 @@ static char *cdiff_token(const char *line, unsigned int token, unsigned int last
if(i == j)
return NULL;
buffer = mmalloc(j - i + 1);
buffer = malloc(j - i + 1);
if(!buffer)
return NULL;
@ -204,7 +203,7 @@ static int cdiff_cmd_add(const char *cmdstr, struct cdiff_ctx *ctx)
return -1;
}
new = mcalloc(1, sizeof(struct cdiff_node));
new = (struct cdiff_node *) calloc(1, sizeof(struct cdiff_node));
if(!new) {
logg("!cdiff_cmd_add: Can't allocate memory for cdiff_node\n");
free(sig);
@ -241,7 +240,7 @@ static int cdiff_cmd_del(const char *cmdstr, struct cdiff_ctx *ctx)
return -1;
}
new = mcalloc(1, sizeof(struct cdiff_node));
new = (struct cdiff_node *) calloc(1, sizeof(struct cdiff_node));
if(!new) {
logg("!cdiff_cmd_del: Can't allocate memory for cdiff_node\n");
free(arg);
@ -304,7 +303,7 @@ static int cdiff_cmd_xchg(const char *cmdstr, struct cdiff_ctx *ctx)
return -1;
}
new = mcalloc(1, sizeof(struct cdiff_node));
new = (struct cdiff_node *) calloc(1, sizeof(struct cdiff_node));
if(!new) {
logg("!cdiff_cmd_xchg: Can't allocate memory for cdiff_node\n");
free(arg);

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002 - 2005 Tomasz Kojm <tkojm@clamav.net>
* Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -27,7 +27,6 @@
#include <ctype.h>
#include "shared/cfgparser.h"
#include "shared/memory.h"
#include "shared/misc.h"
#include "libclamav/str.h"
@ -286,7 +285,7 @@ struct cfgstruct *getcfg(const char *cfgfile, int verbose)
}
ctype = tolower(arg[strlen(arg) - 1]);
if(ctype == 'm' || ctype == 'k') {
char *cpy = (char *) mcalloc(strlen(arg), sizeof(char));
char *cpy = (char *) malloc(strlen(arg));
strncpy(cpy, arg, strlen(arg) - 1);
if(!isnumb(cpy)) {
if(verbose)
@ -441,7 +440,7 @@ static int regcfg(struct cfgstruct **copt, const char *optname, char *strarg, in
struct cfgstruct *newnode, *pt;
newnode = (struct cfgstruct *) mmalloc(sizeof(struct cfgstruct));
newnode = (struct cfgstruct *) malloc(sizeof(struct cfgstruct));
if(!newnode)
return -1;

@ -1,49 +0,0 @@
/*
* Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "memory.h"
void *mmalloc(size_t size)
{
void *alloc;
alloc = malloc(size);
if(!alloc) {
fprintf(stderr, "CRITICAL: Can't allocate memory (%ld bytes).\n", (long int) size);
_exit(71);
return NULL; /* shut up gcc */
} else return alloc;
}
void *mcalloc(size_t nmemb, size_t size)
{
void *alloc;
alloc = calloc(nmemb, size);
if(!alloc) {
fprintf(stderr, "CRITICAL: Can't allocate memory (%ld bytes).\n", (long int) nmemb * size);
_exit(70);
return NULL;
} else return alloc;
}

@ -1,28 +0,0 @@
/*
* Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#ifndef __MEMORY_H
#define __MEMORY_H
#include <stdlib.h>
void *mmalloc(size_t size);
void *mcalloc(size_t nmemb, size_t size);
#endif

@ -1,5 +1,5 @@
/*
* Copyright (C) 2004 - 2005 Tomasz Kojm <tkojm@clamav.net>
* Copyright (C) 2004 - 2007 Tomasz Kojm <tkojm@clamav.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -38,7 +38,6 @@
#include <errno.h>
#include "shared/cfgparser.h"
#include "shared/memory.h"
#include "shared/output.h"
#include "libclamav/clamav.h"
@ -69,7 +68,7 @@ char *freshdbdir(void)
if((copt = getcfg(CONFDIR"/clamd.conf", 0))) {
if((cpt = cfgopt(copt, "DatabaseDirectory"))->enabled || (cpt = cfgopt(copt, "DataDirectory"))->enabled) {
if(strcmp(dbdir, cpt->strarg)) {
char *daily = (char *) mmalloc(strlen(cpt->strarg) + strlen(dbdir) + 30);
char *daily = (char *) malloc(strlen(cpt->strarg) + strlen(dbdir) + 30);
sprintf(daily, "%s/daily.cvd", cpt->strarg);
if(stat(daily, &foo) == -1)
sprintf(daily, "%s/daily.inc/daily.info", cpt->strarg);
@ -113,7 +112,7 @@ void print_version(void)
dbdir = freshdbdir();
if(!(path = mmalloc(strlen(dbdir) + 30))) {
if(!(path = malloc(strlen(dbdir) + 30))) {
free(dbdir);
return;
}

@ -29,7 +29,6 @@
#include "getopt.h"
#include "options.h"
#include "memory.h"
#include "output.h"
@ -70,18 +69,18 @@ static int register_option(struct optstruct *opt, const char *optlong, char opts
}
}
newnode = (struct optnode *) mmalloc(sizeof(struct optnode));
newnode = (struct optnode *) malloc(sizeof(struct optnode));
if(!newnode) {
mprintf("!register_long_option: mmalloc failed\n");
mprintf("!register_long_option: malloc failed\n");
return -1;
}
newnode->optshort = optshort;
if(optarg) {
newnode->optarg = (char *) mcalloc(strlen(optarg) + 1, sizeof(char));
newnode->optarg = (char *) malloc(strlen(optarg) + 1);
if(!newnode->optarg) {
mprintf("!register_long_option: mcalloc failed\n");
mprintf("!register_long_option: malloc failed\n");
free(newnode);
return -1;
}
@ -89,9 +88,9 @@ static int register_option(struct optstruct *opt, const char *optlong, char opts
} else
newnode->optarg = NULL;
newnode->optlong = (char *) mcalloc(strlen(longname) + 1, sizeof(char));
newnode->optlong = (char *) malloc(strlen(longname) + 1);
if(!newnode->optlong) {
mprintf("ERROR: register_long_option: mcalloc failed\n");
mprintf("ERROR: register_long_option: malloc failed\n");
free(newnode->optarg);
free(newnode);
return -1;
@ -134,9 +133,9 @@ struct optstruct *opt_parse(int argc, char * const *argv, const char *getopt_sho
const char *longname;
opt = (struct optstruct *) mcalloc(1, sizeof(struct optstruct));
opt = (struct optstruct *) calloc(1, sizeof(struct optstruct));
if(!opt) {
mprintf("!opt_parse: mcalloc failed\n");
mprintf("!opt_parse: calloc failed\n");
return NULL;
}
@ -183,9 +182,9 @@ struct optstruct *opt_parse(int argc, char * const *argv, const char *getopt_sho
len += strlen(argv[i]);
len += argc - optind - 1;
opt->filename = (char *) mcalloc(len + 64, sizeof(char));
opt->filename = (char *) calloc(len + 64, sizeof(char));
if(!opt->filename) {
mprintf("!opt_parse: mcalloc failed\n");
mprintf("!opt_parse: calloc failed\n");
opt_free(opt);
return NULL;
}

@ -42,7 +42,6 @@
#endif
#include "output.h"
#include "memory.h"
#ifdef CL_NOTHREADS
#undef CL_THREAD_SAFE
@ -180,7 +179,7 @@ int logg(const char *str, ...)
if(logg_time && ((*str != '*') || logg_verbose)) {
time(&currtime);
pt = ctime(&currtime);
timestr = mcalloc(strlen(pt), sizeof(char));
timestr = malloc(strlen(pt));
strncpy(timestr, pt, strlen(pt) - 1);
fprintf(logg_fd, "%s -> ", timestr);
free(timestr);

@ -1,5 +1,5 @@
#
# Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net>
# Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -23,8 +23,6 @@ sigtool_SOURCES = \
$(top_srcdir)/shared/output.h \
$(top_srcdir)/shared/getopt.c \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/cfgparser.c \
$(top_srcdir)/shared/cfgparser.h \
$(top_srcdir)/shared/misc.c \

@ -15,7 +15,7 @@
@SET_MAKE@
#
# Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net>
# Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -70,9 +70,8 @@ am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_sigtool_OBJECTS = output.$(OBJEXT) getopt.$(OBJEXT) \
memory.$(OBJEXT) cfgparser.$(OBJEXT) misc.$(OBJEXT) \
options.$(OBJEXT) cdiff.$(OBJEXT) vba.$(OBJEXT) \
sigtool.$(OBJEXT)
cfgparser.$(OBJEXT) misc.$(OBJEXT) options.$(OBJEXT) \
cdiff.$(OBJEXT) vba.$(OBJEXT) sigtool.$(OBJEXT)
sigtool_OBJECTS = $(am_sigtool_OBJECTS)
sigtool_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
@ -223,8 +222,6 @@ sigtool_SOURCES = \
$(top_srcdir)/shared/output.h \
$(top_srcdir)/shared/getopt.c \
$(top_srcdir)/shared/getopt.h \
$(top_srcdir)/shared/memory.c \
$(top_srcdir)/shared/memory.h \
$(top_srcdir)/shared/cfgparser.c \
$(top_srcdir)/shared/cfgparser.h \
$(top_srcdir)/shared/misc.c \
@ -312,7 +309,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdiff.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfgparser.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
@ -368,20 +364,6 @@ getopt.obj: $(top_srcdir)/shared/getopt.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt.obj `if test -f '$(top_srcdir)/shared/getopt.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/getopt.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/getopt.c'; fi`
memory.o: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.o -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.o `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
memory.obj: $(top_srcdir)/shared/memory.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT memory.obj -MD -MP -MF "$(DEPDIR)/memory.Tpo" -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/memory.Tpo" "$(DEPDIR)/memory.Po"; else rm -f "$(DEPDIR)/memory.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_srcdir)/shared/memory.c' object='memory.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.obj `if test -f '$(top_srcdir)/shared/memory.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/memory.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/memory.c'; fi`
cfgparser.o: $(top_srcdir)/shared/cfgparser.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cfgparser.o -MD -MP -MF "$(DEPDIR)/cfgparser.Tpo" -c -o cfgparser.o `test -f '$(top_srcdir)/shared/cfgparser.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/cfgparser.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cfgparser.Tpo" "$(DEPDIR)/cfgparser.Po"; else rm -f "$(DEPDIR)/cfgparser.Tpo"; exit 1; fi

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002 - 2006 Tomasz Kojm <tkojm@clamav.net>
* Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -46,7 +46,6 @@
#include "vba.h"
#include "shared/options.h"
#include "shared/memory.h"
#include "shared/output.h"
#include "shared/cfgparser.h"
#include "shared/misc.h"
@ -935,7 +934,7 @@ static int unpack(struct optstruct *opt)
if(opt_check(opt, "unpack-current")) {
dbdir = freshdbdir();
name = mcalloc(strlen(dbdir) + strlen(opt_arg(opt, "unpack-current")) + 32, sizeof(char));
name = malloc(strlen(dbdir) + strlen(opt_arg(opt, "unpack-current")) + 32);
sprintf(name, "%s/%s.inc", dbdir, opt_arg(opt, "unpack-current"));
if(stat(name, &sb) != -1) {
@ -1033,8 +1032,7 @@ static int listdir(const char *dirname)
cli_strbcasestr(dent->d_name, ".inc") ||
cli_strbcasestr(dent->d_name, ".cvd"))) {
dbfile = (char *) mcalloc(strlen(dent->d_name) + strlen(dirname) + 2, sizeof(char));
dbfile = (char *) malloc(strlen(dent->d_name) + strlen(dirname) + 2);
if(!dbfile) {
mprintf("!listdir: Can't allocate memory for dbfile\n");
closedir(dd);
@ -1078,7 +1076,7 @@ static int listdb(const char *filename)
return -1;
}
if(!(buffer = (char *) mcalloc(FILEBUFF, 1))) {
if(!(buffer = (char *) malloc(FILEBUFF))) {
mprintf("!listdb: Can't allocate memory for buffer\n");
fclose(fd);
return -1;

Loading…
Cancel
Save