intel / dleyna-renderer

dleyna-renderer is a library for implementing services that allow clients to discover and manipulate Digital Media Renderers. An implementation of such a service for linux is also included
https://01.org/dleyna/
GNU Lesser General Public License v2.1
16 stars 19 forks source link

Blatant memory leak in dlr_device_new #36

Closed markdryan closed 11 years ago

markdryan commented 11 years ago
    dlr_device_t *dev = g_new0(dlr_device_t, 1);
    prv_new_device_ct_t *priv_t;
    gchar *new_path;
    dlr_device_context_t *context;
    GUPnPServiceProxy *s_proxy;

    DLEYNA_LOG_DEBUG("New Device on %s", ip_address);

    new_path = g_strdup_printf("%s/%u", DLEYNA_SERVER_PATH, counter);
    DLEYNA_LOG_DEBUG("Server Path %s", new_path);

    dev = g_new0(dlr_device_t, 1);

Note dev is initialised twice, one at the start of the function and once about ten lines in.

markdryan commented 11 years ago

Fixed by PR #46