[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using libmagic in Emacs?

From: Andreas Schwab
Subject: Re: using libmagic in Emacs?
Date: Sat, 22 Aug 2009 00:46:59 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

address@hidden writes:

> +  GCPRO6 (file_description, file_mime, file_encoding, rv, absname, 
> encoded_absname);

That's too much.  You only need to protect variables used around calls
that can GC.  Arguments to lisp functions are implicitly protected.  For
example, there are no function calls during the lifetime of absname.
And encoded_absname is completely unused.

> + libmagic_error:
> +  report_file_error("Libmagic error",Qnil);
> +  if (cookie != NULL) magic_close (cookie);  

report_file_error throws, so you leak a resource.


Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]