Re: [SPAM] Memory leak in izo_upc_upcall() ?
"chyang" <[email protected]> Tue, 7 Oct 2003 12:55:32 +0800
| Newsgroups | gmane.comp.file-systems.intermezzo.devel |
|---|---|
| Message-ID | <[email protected]> |
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: "±è µ¿¿í" <[email protected]>
To: <[email protected]>
Cc: "'Yang, Chen'" <[email protected]>
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: [email protected] [mailto:intermezzo-
[email protected]] On Behalf Of Yang, Chen
Sent: Tuesday, October 07, 2003 1:35 AM
To: ±è µ¿¿í
Cc: [email protected]
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/intermezzo-devel
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf