Changeset: 568ac610df4c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/568ac610df4c
Modified Files:
        clients/mapiclient/dump.c
        common/stream/xz_stream.c
Branch: Jan2022
Log Message:

Some coverity inspired fixes.


diffs (29 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -3097,8 +3097,8 @@ dump_database(Mapi mid, stream *toConsol
                if (curschema == NULL || strcmp(schema, curschema) != 0) {
                        if (curschema)
                                free(curschema);
-                       curschema = schema ? strdup(schema) : NULL;
-                       if (schema && !curschema) {
+                       curschema = strdup(schema);
+                       if (curschema == NULL) {
                                free(id);
                                free(schema);
                                free(name);
diff --git a/common/stream/xz_stream.c b/common/stream/xz_stream.c
--- a/common/stream/xz_stream.c
+++ b/common/stream/xz_stream.c
@@ -161,9 +161,9 @@ xz_stream(stream *inner, int preset)
                ret = lzma_easy_encoder(&xz->strm, preset, LZMA_CHECK_CRC64);
        }
 
-       stream *s = pump_stream(inner, state);
+       stream *s;
 
-       if (ret != LZMA_OK || s == NULL) {
+       if (ret != LZMA_OK || (s = pump_stream(inner, state)) == NULL) {
                lzma_end(&xz->strm);
                free(xz);
                free(state);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to