Skip to content

Commit

Permalink
Fix compile warnings for
Browse files Browse the repository at this point in the history
   gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)

Signed-off-by: Eberhard S. Amann <[email protected]>
  • Loading branch information
ibm-genwqe authored and fhaverkamp committed Jan 8, 2018
1 parent 389c8e4 commit c01eeaf
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion misc/zpipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ static int inf(FILE *source, FILE *dest)
assert(ret != Z_STREAM_ERROR); /* state not clobbered */
switch (ret) {
case Z_NEED_DICT:
ret = Z_DATA_ERROR; /* and fall through */
(void)inflateEnd(&strm);
return Z_DATA_ERROR;
case Z_DATA_ERROR:
case Z_MEM_ERROR:
(void)inflateEnd(&strm);
Expand Down
5 changes: 4 additions & 1 deletion misc/zpipe_append.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ static int inf(FILE *source, FILE *dest, int window_bits, int _flush,

switch (ret) {
case Z_NEED_DICT:
ret = Z_DATA_ERROR; /* and fall through */
(void)inflateEnd(&strm);
free(in);
free(out);
return Z_DATA_ERROR;
case Z_DATA_ERROR:
case Z_MEM_ERROR:
(void)inflateEnd(&strm);
Expand Down
7 changes: 6 additions & 1 deletion misc/zpipe_mt.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,12 @@ static int inf(struct thread_data *d, FILE *source, FILE *dest,
/* assert(ret != Z_STREAM_ERROR); *//* not clobbered */
switch (ret) {
case Z_NEED_DICT:
ret = Z_DATA_ERROR; /* and fall through */
(void)inflateEnd(&strm);
if (!pre_alloc_memory) {
__free(in);
__free(out);
}
return Z_DATA_ERROR;
case Z_STREAM_ERROR:
case Z_DATA_ERROR:
case Z_MEM_ERROR:
Expand Down
4 changes: 4 additions & 0 deletions misc/zpipe_rnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ static int inf(FILE *source, FILE *dest, int windowBits,
}
goto try_again; /* try again */
}
(void)inflateEnd(&strm);
free(in);
free(out);
return ret;
case Z_DATA_ERROR: /* and fall through */
case Z_MEM_ERROR:
(void)inflateEnd(&strm);
Expand Down
2 changes: 1 addition & 1 deletion tools/genwqe_gzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static int inf(FILE *source, FILE *dest, z_stream *strm,
break;
case Z_NEED_DICT:
fprintf(stderr, "NEED Dict........\n");
ret = Z_DATA_ERROR; /* and fall through */
return Z_DATA_ERROR;
case Z_DATA_ERROR:
case Z_MEM_ERROR:
fprintf(stderr, "Fault..... %d\n", ret);
Expand Down
5 changes: 4 additions & 1 deletion tools/zlib_mt_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,10 @@ static int infl(struct thread_data *d, FILE *source)
/* assert(ret != Z_STREAM_ERROR); *//* not clobbered */
switch (ret) {
case Z_NEED_DICT:
ret = Z_DATA_ERROR; /* and fall through */
(void)inflateEnd(&strm);
__free(in);
__free(out);
return Z_DATA_ERROR;
case Z_STREAM_ERROR:
case Z_DATA_ERROR:
case Z_MEM_ERROR:
Expand Down

0 comments on commit c01eeaf

Please sign in to comment.