Dne 26.8.2011 19:20, Simo Sorce napsal(a):
On Mon, 2011-08-22 at 13:46 +0200, Jakub Hrozek wrote:
> On Tue, Aug 16, 2011 at 02:35:42PM +0200, Pavel Březina wrote:
>> sss_debuglevel - change the debug level on the fly
>> Requires "New DEBUG facility" patches.
>> +errno_t set_debug_level(
>> + struct debuglevel_tool_ctx *tool_ctx, int debug_to_set,
>> + const char *config_file
>> + int ret;
>> + int err;
>> + const char *values;
>> + char **section = NULL;
>> + TALLOC_CTX *ctx = talloc_new(NULL);
> Please name temporary context tmp_ctx so it is immediatelly clear that it
> is a just a temporary one.
I don't like it either and I think we have in the guidelines
about how we use parenthesis. Please follow the style used in the rest
of the sssd code when it comes to declarations.
Sorry about that! I'm used to very different coding style and it's not
like you can switch to this one immediately. But I'll try harder to keep
it on minimum next time. I hope it's good now.
Also, I noticed that I forgot to ask: There are two comments on lines
121 and 122 /* free pc_config_file? */ and /* free debug_as_string? */.
I made some tests and it looks like resources allocated in popt should
be freed manually but I'm not sure as I don't see it anywhere in the code.
There are actually statements like this (monitor.c 2380, 2397):
get string from popt
use string from popt
but no free()
Man page is not clear enough what poptFreeContext() does.