Unix Technical Forum

scripts/common.c minor memory leak

This is a discussion on scripts/common.c minor memory leak within the pgsql Hackers forums, part of the PostgreSQL category; --> Just a minor thing. In yesno_prompt(), the value is resp is allocated memory that is never freed. File: src/bin/scripts/common.c ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 05:07 AM
Martijn van Oosterhout
 
Posts: n/a
Default scripts/common.c minor memory leak

Just a minor thing. In yesno_prompt(), the value is resp is allocated
memory that is never freed.

File: src/bin/scripts/common.c
Line: 218

Not terribly important though, it's not used in critical utilities, but
it's used often.

Found by coverity.
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFItO3IB7bNG8LQkwRAk2bAKCB3AKuon35YAMOEjixN7 P9HQeoBgCeOWpF
5/GvkeMtRwlncGBP9MG2qXw=
=FBVw
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 05:07 AM
Andrew Dunstan
 
Posts: n/a
Default Re: scripts/common.c minor memory leak

Martijn van Oosterhout wrote:
> Just a minor thing. In yesno_prompt(), the value is resp is allocated
> memory that is never freed.
>
> File: src/bin/scripts/common.c
> Line: 218
>
> Not terribly important though, it's not used in critical utilities, but
> it's used often.
>
> Found by coverity.
>


It is surely not the only memory leak. We know there are some and in
most cases (like this) they aren't worth the trouble to clean up. If it
were used in psql or the backend I'd be worried, but it isn't, so I'm not.

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-12-2008, 05:07 AM
Guido Barosio
 
Posts: n/a
Default Re: scripts/common.c minor memory leak

A good spot

Sorry for being no{isy}{vice}{wbie}, but what does it means "found by
coverity" ?

g.-

On 10/3/06, Martijn van Oosterhout <kleptog@svana.org> wrote:
> Just a minor thing. In yesno_prompt(), the value is resp is allocated
> memory that is never freed.
>
> File: src/bin/scripts/common.c
> Line: 218
>
> Not terribly important though, it's not used in critical utilities, but
> it's used often.
>
> Found by coverity.
> --
> Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> > From each according to his ability. To each according to his ability to litigate.

>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
>
> iD8DBQFFItO3IB7bNG8LQkwRAk2bAKCB3AKuon35YAMOEjixN7 P9HQeoBgCeOWpF
> 5/GvkeMtRwlncGBP9MG2qXw=
> =FBVw
> -----END PGP SIGNATURE-----
>
>
>



--
Guido Barosio
-----------------------
http://www.globant.com
guido.barosio@globant.com

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-12-2008, 05:07 AM
Walter Cruz
 
Posts: n/a
Default Re: scripts/common.c minor memory leak

http://en.wikipedia.org/wiki/Coverity

[]'s
- Walter

On 10/3/06, Guido Barosio <gbarosio@gmail.com> wrote:
>
> A good spot
>
> Sorry for being no{isy}{vice}{wbie}, but what does it means "found by
> coverity" ?
>
> g.-
>
> On 10/3/06, Martijn van Oosterhout <kleptog@svana.org> wrote:
> > Just a minor thing. In yesno_prompt(), the value is resp is allocated
> > memory that is never freed.
> >
> > File: src/bin/scripts/common.c
> > Line: 218
> >
> > Not terribly important though, it's not used in critical utilities, but
> > it's used often.
> >
> > Found by coverity.
> > --
> > Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> > > From each according to his ability. To each according to his ability

> to litigate.
> >
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.1 (GNU/Linux)
> >
> > iD8DBQFFItO3IB7bNG8LQkwRAk2bAKCB3AKuon35YAMOEjixN7 P9HQeoBgCeOWpF
> > 5/GvkeMtRwlncGBP9MG2qXw=
> > =FBVw
> > -----END PGP SIGNATURE-----
> >
> >
> >

>
>
> --
> Guido Barosio
> -----------------------
> http://www.globant.com
> guido.barosio@globant.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-12-2008, 05:07 AM
Martijn van Oosterhout
 
Posts: n/a
Default Re: scripts/common.c minor memory leak

On Tue, Oct 03, 2006 at 05:27:31PM -0400, Andrew Dunstan wrote:
> It is surely not the only memory leak. We know there are some and in
> most cases (like this) they aren't worth the trouble to clean up. If it
> were used in psql or the backend I'd be worried, but it isn't, so I'm not.


Ofcourse not. You don't see any messages about the other >100 leaks
found because I figure they're not worth the effort. This function is
used widely enough and a simple enough fix that I figured I might be
worth fixing.

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFI4L7IB7bNG8LQkwRAvgnAJ9nPr1CXDYyO6NBqHQXcp RO9Kd+EgCfY5c2
SsycmpbGC6Bitt8VVI+mz9o=
=f6En
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:15 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com