Hi Mahesh,

No, it does not. Valgrind only reports where memory is allocated.
I missed this part of the code. There should also be a freeing of memory.

Thanks,
Zoran

-----Original Message-----
From: A V Mahesh [mailto:[email protected]] 
Sent: Thursday, August 27, 2015 6:04 AM
To: Zoran Milinkovic
Cc: [email protected]
Subject: Re: [PATCH 1 of 1] mds: fix memory leak in MDS auth server [#1462]

Hi Zoran,

Dose valgrind report any thing at below code (mds_dt_common.c) as well ?
we have  (void)mds_process_info_del(info) as well.

case MDS_DOWN_TMR: {
                                 MDS_PROCESS_INFO *info = mds_process_info_get( 
tmr_req_info->info.down_event_tmr_info.adest,
tmr_req_info->info.down_event_tmr_info.svc_id);
                                 /* only delete if process not exist to avoid 
race with a client
                                  * that re-registers immediately after 
unregister */
                                 if ((info != NULL) && (kill(info->pid,
0) == -1)) {
                                         TRACE("TIMEOUT, deleting entry for 
%"PRIx64", pid:%d",
                                                 info->mds_dest, info->pid); 
(void)mds_process_info_del(info);
                                 }
                                 break;

-AVM


On 8/26/2015 9:19 PM, Zoran Milinkovic wrote:
>   osaf/libs/core/mds/mds_main.c |  1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
>
> Free allocated memory for MDS_PROCESS_INFO structure when 
> mds_register_callback() receives MDS_UNREGISTER_REQ.
>
> diff --git a/osaf/libs/core/mds/mds_main.c b/osaf/libs/core/mds/mds_main.c
> --- a/osaf/libs/core/mds/mds_main.c
> +++ b/osaf/libs/core/mds/mds_main.c
> @@ -191,6 +191,7 @@ static void mds_register_callback(int fd
>               MDS_PROCESS_INFO *info = mds_process_info_get(mds_dest, svc_id);
>               if (info != NULL) {
>                       (void)mds_process_info_del(info);
> +                     free(info);
>               }
>               osaf_mutex_unlock_ordie(&gl_mds_library_mutex);
>   


------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to