Re: [QUESTION]
- From: Seebs <usenet-nospam@xxxxxxxxx>
- Date: 25 Aug 2010 05:35:52 GMT
On 2010-08-25, parjit <nospam@xxxxxxxxxx> wrote:
Seebs wrote:
Not at all. Try putting the question into words, such as:and free
If I allocate something in a function, and return the pointer,
it in another function, does that create a memory leak?
That would allow people to be more sure of what you were trying to do.
Actually my question was not from a negative experience, but as a result
of a discussion with someone. I argued that tho it was a bad programming
practice, it didn't necessarily create a memory leak by virtue of its
syntax. I'm still not sure if I was right or not.
I don't see what you think is a bad programming practice.
EXPLAIN your question, don't just expect us to guess it from your
sample program. What was the discussion? What do you think is "bad"
about it? What on earth do you mean by "by virtue of its syntax"? Syntax
is not what creates memory leaks. And there is no memory leak in that
code.
-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam@xxxxxxxxx
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
.
- Follow-Ups:
- Re: [QUESTION]
- From: parjit
- Re: [QUESTION]
- References:
- [QUESTION]
- From: parjit
- Re: [QUESTION]
- From: Seebs
- Re: [QUESTION]
- From: parjit
- [QUESTION]
- Prev by Date: Re: trim whitespace
- Next by Date: Re: trim whitespace
- Previous by thread: Re: [QUESTION]
- Next by thread: Re: [QUESTION]
- Index(es):
Relevant Pages
|