Merge branch 't/clang_analyzer_fixes'
authorAndre Noll <maan@systemlinux.org>
Sat, 15 Oct 2011 13:36:38 +0000 (15:36 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 15 Oct 2011 13:36:38 +0000 (15:36 +0200)
aac_afh.c
command.c
crypt.c
dccp_recv.c
imdct.c
ogg_afh.c
wmadec_filter.c

index a53a757..7acb011 100644 (file)
--- 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;
index 3ba4310..b6861b8 100644 (file)
--- 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 7b7c16d..431de6f 100644 (file)
--- 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;
index af8e6b1..a9eab00 100644 (file)
@@ -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 3292848..aab498a 100644 (file)
--- 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,
index 46c7b08..0802345 100644 (file)
--- 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;
index 0b381c5..c6eb0b1 100644 (file)
@@ -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]);