unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* notmuch-0.21 bug report
@ 2016-04-25 16:00 David Binderman
  2016-04-25 18:16 ` David Bremner
  0 siblings, 1 reply; 4+ messages in thread
From: David Binderman @ 2016-04-25 16:00 UTC (permalink / raw)
  To: notmuch@notmuchmail.org

Hello there,

[notmuch-count.c:207]: (error) Resource leak: input

Source code is

   if (notmuch_database_open (notmuch_config_get_database_path (config),
                   NOTMUCH_DATABASE_MODE_READ_ONLY, &notmuch))
    return EXIT_FAILURE;

Suggest call fclose.

Some duplicates:

[notmuch-count.c:214]: (error) Resource leak: input
[notmuch-count.c:202]: (error) Resource leak: input

Regards

David Binderman

 		 	   		  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: notmuch-0.21 bug report
  2016-04-25 16:00 notmuch-0.21 bug report David Binderman
@ 2016-04-25 18:16 ` David Bremner
  2016-04-25 18:26   ` David Binderman
  0 siblings, 1 reply; 4+ messages in thread
From: David Bremner @ 2016-04-25 18:16 UTC (permalink / raw)
  To: David Binderman, notmuch@notmuchmail.org


David Binderman <dcb314@hotmail.com> writes:

> Hello there,
>
> [notmuch-count.c:207]: (error) Resource leak: input
>
> Source code is
>
>    if (notmuch_database_open (notmuch_config_get_database_path (config),
>                    NOTMUCH_DATABASE_MODE_READ_ONLY, &notmuch))
>     return EXIT_FAILURE;
>
> Suggest call fclose.
>
> Some duplicates:
>
> [notmuch-count.c:214]: (error) Resource leak: input
> [notmuch-count.c:202]: (error) Resource leak: input

Hi David;

Thanks for the report. fclose doesn't really make sense here; what is
that error message from?

d

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: notmuch-0.21 bug report
  2016-04-25 18:16 ` David Bremner
@ 2016-04-25 18:26   ` David Binderman
  2016-04-25 19:40     ` David Bremner
  0 siblings, 1 reply; 4+ messages in thread
From: David Binderman @ 2016-04-25 18:26 UTC (permalink / raw)
  To: David Bremner, notmuch@notmuchmail.org

Hello there,

----------------------------------------
> Hi David;
>
> Thanks for the report. fclose doesn't really make sense here; 

Surprising. There is a call to fclose for the success return,
so I just assumed that one would also be required for the error return.

>what is that error message from?

cppcheck, a static analysis tool available from sourceforge.


Regards

David Binderman

 		 	   		  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: notmuch-0.21 bug report
  2016-04-25 18:26   ` David Binderman
@ 2016-04-25 19:40     ` David Bremner
  0 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2016-04-25 19:40 UTC (permalink / raw)
  To: David Binderman, notmuch@notmuchmail.org

David Binderman <dcb314@hotmail.com> writes:

> Hello there,
>
> ----------------------------------------
>> Hi David;
>>
>> Thanks for the report. fclose doesn't really make sense here; 
>
> Surprising. There is a call to fclose for the success return,
> so I just assumed that one would also be required for the error return.
>

Ah OK, I thought the fclose referred to the notmuch database, but it
refers to the input file. So yes, there is techically a resource leakage
here, but I'm not sure how important it is, since these returns are part
of program shutdown. Is there any harm in having FILEs open for read
when a program shuts down? On the other hand, I guess it would only take
5 or 6 added lines of code if someone wanted to add our usual "goto
DONE" path

d

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-25 19:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-25 16:00 notmuch-0.21 bug report David Binderman
2016-04-25 18:16 ` David Bremner
2016-04-25 18:26   ` David Binderman
2016-04-25 19:40     ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).