diff --git a/cmdline/dup.c b/cmdline/dup.c index 0434ba6f..0693300e 100644 --- a/cmdline/dup.c +++ b/cmdline/dup.c @@ -54,6 +54,7 @@ struct snapraid_hash* hash_alloc(struct snapraid_state* state, struct snapraid_d if (!block_has_updated_hash(&file->blockvec[i])) { free(buf); + free(hash); return 0; } } diff --git a/cmdline/state.c b/cmdline/state.c index 3a176fbd..e7eb6360 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -4043,7 +4043,7 @@ void state_write(struct snapraid_state* state) if (sclose(f) != 0) { /* LCOV_EXCL_START */ - fprintf(stderr, "Error writing the content file '%s' in close(). %s.\n", serrorfile(f), strerror(errno)); + fprintf(stderr, "Error closing the content files in close(). %s.\n", strerror(errno)); exit(EXIT_FAILURE); /* LCOV_EXCL_STOP */ } diff --git a/cmdline/util.c b/cmdline/util.c index 720d6182..f3ee821d 100644 --- a/cmdline/util.c +++ b/cmdline/util.c @@ -538,7 +538,7 @@ int sgethex(STREAM* f, void* void_data, int size) return -1; /* LCOV_EXCL_STOP */ } - b0 = strdecset[c]; + b0 = strdecset[(unsigned char)c]; c = sgetc(f); if (c == EOF) { @@ -546,7 +546,7 @@ int sgethex(STREAM* f, void* void_data, int size) return -1; /* LCOV_EXCL_STOP */ } - b1 = strdecset[c]; + b1 = strdecset[(unsigned char)c]; b = (b0 << 4) | b1; @@ -1670,7 +1670,7 @@ int lock_lock(const char* file) /* LCOV_EXCL_STOP */ } - return 0; + return f; } #endif diff --git a/raid/test.c b/raid/test.c index dde71975..a7189623 100644 --- a/raid/test.c +++ b/raid/test.c @@ -281,7 +281,7 @@ int raid_test_par(int mode, int nd, size_t size) /* check memory */ if (raid_mtest_vector(nv, size, v) != 0) - return -1; + goto bail; /* fill with random */ raid_mrand_vector(nv, size, v);