Changeset: 80d2e8be7120 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=80d2e8be7120
Modified Files:
        clients/src/mapiclient/stethoscope.c
Branch: Oct2010
Log Message:

make sure we do not leave the thds structure uninitialised if we happened to 
have nothing to redirect to


diffs (41 lines):

diff -r c588fe6f04e1 -r 80d2e8be7120 clients/src/mapiclient/stethoscope.c
--- a/clients/src/mapiclient/stethoscope.c      Thu Sep 16 11:39:08 2010 +0200
+++ b/clients/src/mapiclient/stethoscope.c      Thu Sep 16 15:48:26 2010 +0200
@@ -444,21 +444,23 @@
                free(walk);
        } else {
                /* fork runner threads for all alternatives */
-               walk = thds = malloc(sizeof(wthread));
                i = 1;
-               if (*alts != NULL) while (1) {
-                       walk->tid = i++;
-                       walk->uri = *alts;
-                       walk->user = user;
-                       walk->pass = password;
-                       walk->argc = argc - a;
-                       walk->argv = &argv[a];
-                       walk->s = NULL;
-                       pthread_create(&walk->id, NULL, &doProfile, walk);
-                       alts++;
-                       if (*alts == NULL)
-                               break;
-                       walk = walk->next = malloc(sizeof(wthread));
+               if (*alts != NULL) {
+                       walk = thds = malloc(sizeof(wthread));
+                       while (1) {
+                               walk->tid = i++;
+                               walk->uri = *alts;
+                               walk->user = user;
+                               walk->pass = password;
+                               walk->argc = argc - a;
+                               walk->argv = &argv[a];
+                               walk->s = NULL;
+                               pthread_create(&walk->id, NULL, &doProfile, 
walk);
+                               alts++;
+                               if (*alts == NULL)
+                                       break;
+                               walk = walk->next = malloc(sizeof(wthread));
+                       }
                }
                walk->next = NULL;
                free(oalts);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to