Changeset: 388aa73a2933 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=388aa73a2933
Modified Files:
tools/merovingian/client/monetdb.c
Branch: Jul2017
Log Message:
Improve checks.
diffs (33 lines):
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
@@ -1306,14 +1306,16 @@ command_get(int argc, char *argv[])
fprintf(stderr, "get: %s\n", e);
free(e);
exit(2);
- } else if ( buf && strncmp(buf, "OK\n", 3) != 0) {
+ } else if (buf == NULL) {
+ fprintf(stderr, "get: malloc failed\n");
+ exit(2);
+ } else if (strncmp(buf, "OK\n", 3) != 0) {
fprintf(stderr, "get: %s\n", buf);
free(buf);
exit(1);
}
readPropsBuf(defprops, buf + 3);
- if( buf)
- free(buf);
+ free(buf);
if (twidth > 0) {
/* name = 15 */
@@ -1332,6 +1334,9 @@ command_get(int argc, char *argv[])
fprintf(stderr, "get: %s\n", e);
free(e);
exit(2);
+ } else if (buf == NULL) {
+ fprintf(stderr, "get: malloc failed\n");
+ exit(2);
} else if (strncmp(buf, "OK\n", 3) != 0) {
fprintf(stderr, "get: %s\n", buf);
free(buf);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list