[prev in list] [next in list] [prev in thread] [next in thread] 

List:       intermezzo-devel
Subject:    Re: [SPAM] Memory leak in izo_upc_upcall() ?
From:       "chyang" <chyang () clusterfs ! com>
Date:       2003-10-07 4:55:32
[Download RAW message or body]

Hi, I looked into the code. Yes, there should be some code to free the
allocated buffer. The presto_free code should be right after the exit_buf
label. For some branches to exit_buf will not have the buffer freed if the
free code is right after the exit_req label.
It seems that the code should be:
  exit_req:
     PRESTO_FREE(req, sizeof(struct upc_req));
 exit_buf:
     PRESTO_FREE(buffer,*size);
     return error;
}
   Thanks for your message. :-)
--
   Yang, Chen

----- Original Message ----- 
From: "±è µ¿¿í" <kdw@neowiz.com>
To: <intermezzo-devel@lists.sourceforge.net>
Cc: "'Yang, Chen'" <chyang@clusterfs.com>
Sent: Tuesday, October 07, 2003 10:05
Subject: RE: [SPAM] Memory leak in izo_upc_upcall() ?



Yes, we know that the req->rq_data is a pointer to the input parameter
to the izo_upc_upcall(). But the parameter was alloc'ed using
PRESTO_ALLOC() in the caller functions like izo_upc_permit(). So we
need to free the parameter using PRESTO_FREE(), don't we ?


-----Original Message-----
From: intermezzo-devel-admin@lists.sourceforge.net [mailto:intermezzo-
devel-admin@lists.sourceforge.net] On Behalf Of Yang, Chen
Sent: Tuesday, October 07, 2003 1:35 AM
To: ±è µ¿¿í
Cc: intermezzo-devel@lists.sourceforge.net
Subject: Re: [SPAM] Memory leak in izo_upc_upcall() ?

Hi, This should not cause memory leakage. Only those called presto_alloc
routines should call presto_free routine to free the memory. From the
routine, we can see that req->rq_data is just a pointer to the parameter
passed in. So it should not be free-ed.
   If there is something wrong, please correct me.Thanks.
--
   Yang, Chen
> Hi, I¡¯ve tried the new version 1.42 2003/09/30 of intermezzo
> and I think there¡¯s a memory leak at the near of the end the
> izo_upc_upcall().
>
> ...
> exit_req:
>     PRESTO_FREE(req->rq_data, req->rq_bufsiz); // I think this line is
> missing.
>     PRESTO_FREE(req, sizeof(struct upc_req));
> exit_buf:
>     return error;
> }
>
>
>



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
intermezzo-devel mailing list
intermezzo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/intermezzo-devel




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
intermezzo-devel mailing list
intermezzo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/intermezzo-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic