Changeset 054f3079 in mainline


Ignore:
Timestamp:
2014-02-10T15:20:59Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b6e481b
Parents:
dbb29de (diff), 9163546 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

hound: Plug memory leaks

Location:
uspace/srv/audio/hound
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/audio_data.c

    rdbb29de r054f3079  
    4545 * @param size Size of the @p data buffer.
    4646 * @param fomart audio data format.
    47  * @return pointer to valid audio data structre, NULL on failure.
     47 * @return pointer to valid audio data structure, NULL on failure.
    4848 */
    4949audio_data_t *audio_data_create(const void *data, size_t size,
  • uspace/srv/audio/hound/audio_device.c

    rdbb29de r054f3079  
    4242#include <str.h>
    4343#include <str_error.h>
     44#include <sys/mman.h>
    4445
    4546
     
    380381        const int ret = audio_pcm_release_buffer(dev->sess);
    381382        if (ret == EOK) {
     383                munmap(dev->buffer.base, dev->buffer.size);
    382384                dev->buffer.base = NULL;
    383385                dev->buffer.size = 0;
  • uspace/srv/audio/hound/hound_ctx.c

    rdbb29de r054f3079  
    418418                connection_push_data(conn, adata);
    419419        }
     420        /* all connections should now have their refs */
     421        audio_data_unref(adata);
    420422        fibril_mutex_unlock(&ctx->guard);
    421423        return EOK;
  • uspace/srv/audio/hound/iface.c

    rdbb29de r054f3079  
    3838#include <hound/protocol.h>
    3939#include <inttypes.h>
    40 #include <malloc.h>
    4140
    4241#include "hound.h"
     
    7069        if (!ctx)
    7170                return EINVAL;
    72         int ret = hound_remove_ctx(server, ctx);
    73         if (ret != EOK)
    74                 return ret;
    75         hound_ctx_destroy(ctx);
    76         log_info("%s: %p, %#" PRIxn, __FUNCTION__, server, id);
    77         return EOK;
     71        const int ret = hound_remove_ctx(server, ctx);
     72        if (ret == EOK) {
     73                hound_ctx_destroy(ctx);
     74                log_info("%s: %p, %#" PRIxn, __FUNCTION__, server, id);
     75        }
     76        return ret;
    7877}
    7978
Note: See TracChangeset for help on using the changeset viewer.