[Pkg-nagios-changes] [SCM] Debian packaging for mod gearman. branch, upstream, updated. upstream/1.0.6-34-gd3fb2ec

Sven Nierlein sven at nierlein.de
Wed Aug 24 09:21:48 UTC 2011


The following commit has been merged in the upstream branch:
commit c9f94d3c4a6509f44576d24d9716127cb36351af
Author: Sven Nierlein <sven at nierlein.de>
Date:   Sun Jul 17 19:44:15 2011 +0200

    removed memory leak in gearman_top

diff --git a/Changes b/Changes
index c640f13..6530a41 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,7 @@ This file documents the revision history for mod_gearman.
 1.0.8  Fri Jul 15 20:24:27 CEST 2011
           - use identifier for error messages if set
           - fixed ld options (fixes debian bug #632431) thanks Ilya Barygin
+          - removed memory leak in gearman_top
 
 1.0.7  Sun Jul  3 15:18:16 CEST 2011
           - show plugin output for exit codes > 3
diff --git a/common/gearman_utils.c b/common/gearman_utils.c
index 532c3b8..aaf9f02 100644
--- a/common/gearman_utils.c
+++ b/common/gearman_utils.c
@@ -128,6 +128,7 @@ int get_gearman_server_data(mod_gm_server_status_t *stats, char ** message, char
 
         /* skip the dummy queue if its empty */
         if(!strcmp( name, "dummy") && func->total == 0) {
+            free(func->queue);
             free(func);
             continue;
         }
@@ -145,7 +146,7 @@ int get_gearman_server_data(mod_gm_server_status_t *stats, char ** message, char
 
 /* free a status structure */
 void free_mod_gm_status_server(mod_gm_server_status_t *stats) {
-    int x = 0;
+    int x;
 
     for(x=0; x<stats->function_num;x++) {
         free(stats->function[x]->queue);
diff --git a/t/02-full.c b/t/02-full.c
index d69d617..354f8e1 100644
--- a/t/02-full.c
+++ b/t/02-full.c
@@ -177,7 +177,7 @@ void wait_for_empty_queue(char *queue, int timeout) {
         tries++;
         stats = malloc(sizeof(mod_gm_server_status_t));
         stats->function_num = 0;
-        stats->worker_num = 0;
+        stats->worker_num   = 0;
         rc = get_gearman_server_data(stats, &message, &version, "localhost", GEARMAND_TEST_PORT);
         if( rc == STATE_OK ) {
             for(x=0; x<stats->function_num;x++) {
@@ -196,7 +196,7 @@ void wait_for_empty_queue(char *queue, int timeout) {
         sleep(1);
     }
 
-    ok(tries <= 10, "queue %s empty after %d seconds", queue, tries);
+    ok(tries < timeout, "queue %s empty after %d seconds", queue, tries);
     return;
 }
 

-- 
Debian packaging for mod gearman.



More information about the Pkg-nagios-changes mailing list