# HG changeset patch # User Markus Bröker # Date 1229179339 -3600 # Node ID 08ec6ddd6eea68a6a57e71be994d0b4227819afa # Parent ef929533d040201c980a555e068460b4f4bb5ec3 command must be freed - makes valgrind happy trivial changes to the debian build process committer: Markus Bröker diff --git a/debian/changelog b/debian/changelog --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mcbot (0.96-2) unstable; urgency=low +mcbot (0.96-3) unstable; urgency=low * Initial Release * the location of mcbot.cgi is stored in the db @@ -27,5 +27,6 @@ * mcbot.cgi installation defaults to /usr/lib/cgi-bin * Build Dependency Check improved. * Lintian Build Checks + * command must be freed on error - makes valgrind happy -- Markus Broeker Sun, 24 Aug 2008 20:30:00 +0200 diff --git a/debian/rules b/debian/rules --- a/debian/rules +++ b/debian/rules @@ -17,7 +17,6 @@ dh_testdir # Add here commands to configure the package. - cmake src/ touch configure-stamp @@ -38,8 +37,7 @@ rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. - if [ -f Makefile ]; then $(MAKE) clean; fi - rm -rf Makefile CMake* install* mcbot dbtool cmake_install.cmake + $(MAKE) distclean dh_clean install: build diff --git a/src/irc.c b/src/irc.c --- a/src/irc.c +++ b/src/irc.c @@ -252,8 +252,10 @@ return NULL; #endif case ENOMEM: + return "ENOMEM"; case ERROR: - return command; + free (command); + return "ERROR"; case VERSION: if ((ptr = strchr (message->user, ' '))) *ptr = '\0'; diff --git a/src/main.c b/src/main.c --- a/src/main.c +++ b/src/main.c @@ -99,8 +99,9 @@ if ((command = irc_parsemessage (buf, &message))) { printf ("%10s %s %s\n", command, message.channel, message.line); - if (!strcmp (command, "ERROR") || !strcmp (command, "ENOMEM")) + if (!strcmp (command, "ERROR") || !strcmp (command, "ENOMEM")) { break; + } } else { if ((msg = parse (&message)) != NULL) { fprintf (message.stream, "%s\r\n", msg);