From: Andre Noll Date: Sat, 15 Oct 2011 13:36:38 +0000 (+0200) Subject: Merge branch 't/clang_analyzer_fixes' X-Git-Tag: v0.4.9~18 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=63aab30b55d5809704a2d0e1c4e8de20e8228d7d;hp=fb5d56ca5ec72163e2ef0665a857a9020679be0a Merge branch 't/clang_analyzer_fixes' --- diff --git a/aac_afh.c b/aac_afh.c index a53a757f..7acb011d 100644 --- a/aac_afh.c +++ b/aac_afh.c @@ -191,8 +191,7 @@ static int aac_set_chunk_tv(struct afh_info *afhi, { float tmp = mp4ASC->sbr_present_flag == 1? 2047 : 1023; struct timeval total; - long unsigned ms = 1000.0 * afhi->chunks_total * tmp - / mp4ASC->samplingFrequency; + long unsigned ms; if (!mp4ASC->samplingFrequency) return -E_MP4ASC; diff --git a/command.c b/command.c index 3ba43105..b6861b88 100644 --- a/command.c +++ b/command.c @@ -763,13 +763,11 @@ __noreturn void handle_connect(int fd, const char *peername) ret = -E_AUTH_REQUEST; goto net_err; } - numbytes = ret; ret = -E_AUTH_REQUEST; if (strncmp(buf, AUTH_REQUEST_MSG, strlen(AUTH_REQUEST_MSG))) goto net_err; p = buf + strlen(AUTH_REQUEST_MSG); PARA_DEBUG_LOG("received auth request for user %s\n", p); - ret = -E_BAD_USER; u = lookup_user(p); if (u) { get_random_bytes_or_die(rand_buf, sizeof(rand_buf)); diff --git a/crypt.c b/crypt.c index 7b7c16d3..431de6fe 100644 --- a/crypt.c +++ b/crypt.c @@ -184,24 +184,25 @@ int get_asymmetric_key(const char *key_file, int private, PARA_INFO_LOG("decoding public rsa-ssh key %s\n", key_file); ret = -ERRNO_TO_PARA_ERROR(EOVERFLOW); if (map_size > INT_MAX / 4) - goto out; + goto out_unmap; blob_size = 2 * map_size; blob = para_malloc(blob_size); ret = uudecode(cp, blob, blob_size); if (ret < 0) - goto out; + goto out_unmap; decoded_size = ret; ret = check_ssh_key_header(blob, decoded_size); if (ret < 0) - goto out; + goto out_unmap; ret = read_rsa_bignums(blob + ret, decoded_size - ret, &key->rsa); if (ret < 0) - goto out; + goto out_unmap; ret = RSA_size(key->rsa); -out: +out_unmap: ret2 = para_munmap(map, map_size); if (ret >= 0 && ret2 < 0) ret = ret2; +out: if (ret < 0) { free(key); *result = NULL; diff --git a/dccp_recv.c b/dccp_recv.c index af8e6b16..a9eab006 100644 --- a/dccp_recv.c +++ b/dccp_recv.c @@ -40,13 +40,14 @@ struct private_dccp_recv_data { static void dccp_recv_close(struct receiver_node *rn) { - struct private_dccp_recv_data *pdd = rn->private_data; - if (pdd && pdd->fd > 0) + if (!pdd) + return; + if (pdd->fd > 0) close(pdd->fd); btr_pool_free(pdd->btrp); - free(rn->private_data); + free(pdd); rn->private_data = NULL; } diff --git a/imdct.c b/imdct.c index 32928487..aab498a3 100644 --- a/imdct.c +++ b/imdct.c @@ -293,7 +293,6 @@ static void imdct_half(struct mdct_context *s, fftsample_t *output, fft(&s->fft, z); /* post rotation + reordering */ - output += n4; for (k = 0; k < n8; k++) { fftsample_t r0, i0, r1, i1; CMUL(r0, i1, z[n8 - k - 1].im, z[n8 - k - 1].re, diff --git a/ogg_afh.c b/ogg_afh.c index 46c7b084..08023458 100644 --- a/ogg_afh.c +++ b/ogg_afh.c @@ -105,7 +105,6 @@ static int vorbis_get_header_callback(ogg_packet *packet, int packet_num, return 0; if (packet_num == 0) { ogg_stream_init(&vghd->os, serial); - ret = -E_OGG_PACKET_IN; ret = ogg_stream_packetin(&vghd->os, packet); if (ret < 0) goto out; diff --git a/wmadec_filter.c b/wmadec_filter.c index 0b381c5d..c6eb0b1c 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -769,7 +769,6 @@ static void compute_mdct_coefficients(struct private_wmadec_data *pwd, *coefs++ = 0.0; continue; } - mult1 = mult; n1 = pwd->exponent_high_sizes[bsize]; /* compute power of high bands */ exponents = pwd->exponents[ch] + @@ -803,8 +802,7 @@ static void compute_mdct_coefficients(struct private_wmadec_data *pwd, mult1 = sqrt(exp_power[j] / exp_power[last_high_band]); /* XXX: use a table */ - mult1 = mult1 * pow(10, - pwd->high_band_values[ch][j] * 0.05); + mult1 *= pow(10, pwd->high_band_values[ch][j] * 0.05); mult1 /= (pwd->max_exponent[ch] * pwd->noise_mult); mult1 *= mdct_norm; for (i = 0; i < n; i++) { @@ -1012,7 +1010,6 @@ next: for (ch = 0; ch < pwd->ahi.channels; ch++) { int n4, idx; - n = pwd->block_len; n4 = pwd->block_len / 2; if (pwd->channel_coded[ch]) imdct(pwd->mdct_ctx[bsize], pwd->output, pwd->coefs[ch]);