Changeset: 08f2ad2d882b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=08f2ad2d882b
Modified Files:
        common/options/monet_options.c
        tools/merovingian/client/monetdb.c
        tools/merovingian/daemon/controlrunner.c
Branch: Oct2014
Log Message:

Fixed u couple of issues discovered by Coverity.


diffs (65 lines):

diff --git a/common/options/monet_options.c b/common/options/monet_options.c
--- a/common/options/monet_options.c
+++ b/common/options/monet_options.c
@@ -125,9 +125,9 @@ mo_config_file(opt **Set, int setlen, ch
                if (default_set == NULL) {
                        set = NULL;
                        setlen = mo_default_set(&set, 0);
-               }
+               } else
+                       setlen = default_setlen;
                Set = &default_set;
-               setlen = default_setlen;
        }
        set = *Set;
        fd = fopen(file, "r");
@@ -209,9 +209,9 @@ mo_system_config(opt **Set, int setlen)
                        opt *set = NULL;
 
                        setlen = mo_default_set(&set, 0);
-               }
+               } else
+                       setlen = default_setlen;
                Set = &default_set;
-               setlen = default_setlen;
        }
        cfg = mo_find_option(*Set, setlen, "config");
        if (!cfg)
@@ -305,9 +305,9 @@ mo_add_option(opt **Set, int setlen, opt
                if (default_set == NULL) {
                        set = NULL;
                        setlen = mo_default_set(&set, 0);
-               }
+               } else
+                       setlen = default_setlen;
                Set = &default_set;
-               setlen = default_setlen;
        }
        set = (opt *) realloc(*Set, (setlen + 1) * sizeof(opt));
        set[setlen].kind = kind;
diff --git a/tools/merovingian/client/monetdb.c 
b/tools/merovingian/client/monetdb.c
--- a/tools/merovingian/client/monetdb.c
+++ b/tools/merovingian/client/monetdb.c
@@ -1168,6 +1168,11 @@ command_set(int argc, char *argv[], mero
        msab_freeStatus(&orig);
        orig = stats;
 
+       if (orig == NULL) {
+               /* error already printed by globMatchDBS */
+               exit(1);
+       }
+
        /* handle rename separately due to single argument constraint */
        if (strcmp(property, "name") == 0) {
                if (type == INHERIT) {
diff --git a/tools/merovingian/daemon/controlrunner.c 
b/tools/merovingian/daemon/controlrunner.c
--- a/tools/merovingian/daemon/controlrunner.c
+++ b/tools/merovingian/daemon/controlrunner.c
@@ -683,6 +683,7 @@ static void ctl_handle_client(
                                                Mfprintf(_mero_ctlerr, "%s: 
set: cannot perform "
                                                                "client share 
request: discovery service "
                                                                "is globally 
disabled\n", origin);
+                                               msab_freeStatus(&stats);
                                                continue;
                                        }
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to