diff options
| author | Nathan Moinvaziri <nathan@nathanm.com> | 2026-02-11 11:32:42 -0800 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2026-02-17 17:29:13 +0100 |
| commit | b9a22d68bfee523a7b5f100b08af7deb8619dcd8 (patch) | |
| tree | 4b254f9b9a665fac30fdacfa9bd2a2c6a8a36211 | |
| parent | faa8386792331b05f2163c7c1152b8e0f2c5c247 (diff) | |
| download | Project-Tick-b9a22d68bfee523a7b5f100b08af7deb8619dcd8.tar.gz Project-Tick-b9a22d68bfee523a7b5f100b08af7deb8619dcd8.zip | |
Remove unnecessary casts on malloc return values
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 4161f7d0eb58
| -rw-r--r-- | gzlib.c | 4 | ||||
| -rw-r--r-- | zutil_p.h | 2 |
2 files changed, 3 insertions, 3 deletions
@@ -204,7 +204,7 @@ static gzFile gz_open(const void *path, int fd, const char *mode) { } else #endif len = strlen((const char *)path); - state->path = (char *)malloc(len + 1); + state->path = malloc(len + 1); if (state->path == NULL) { gz_state_free(state); return NULL; @@ -577,7 +577,7 @@ void Z_INTERNAL PREFIX(gz_error)(gz_state *state, int err, const char *msg) { return; /* construct error message with path */ - if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) == NULL) { + if ((state->msg = malloc(strlen(state->path) + strlen(msg) + 3)) == NULL) { state->err = Z_MEM_ERROR; return; } @@ -10,7 +10,7 @@ // Zlib-ng's default alloc/free implementation, used unless // application supplies its own alloc/free functions. static inline void *zng_alloc(size_t size) { - return (void *)malloc(size); + return malloc(size); } static inline void zng_free(void *ptr) { |
