|
From: Luiz A. D. de L. <lui...@gm...> - 2011-07-18 00:20:51
|
This one might not be a bug. I might be wrong but let's see:
Still in file-sync module/src/file_sync.c at get_sync_info:
If some error occurs, it calls:
osync_error_unref(error);
However, error was not allocated here. It is passed as argument. If it is an
argument, probably the caller wishes to know if an error occurs and it also
responsible to free it. I guess no function that receives "OSyncError
**error" refs it (osync_error_ref(error)) or unrefs it. So, the result, I
guess, is that, if some error happens, error is freed inside get_sync_info
and the caller will never know. Even worse if the caller wishes to deref it,
it will segfalts.
Regards,
---
Luiz Angelo Daros de Luca, Me.
lui...@gm...
2011/7/17 Luiz Angelo Daros de Luca <lui...@gm...>
> Hello,
>
> I don't know it the bug tracker at the site is still valid so I'm writing
> about the bug I found to the list.
> Correct me if I'm wrong.
>
> File-sync/src/file-sync.c at osync_filesync_initialize:
>
> "OSyncFileEnv *env" is initialized with no problem. It contains only a list
> of "GList *directories". However, this list is never filled.
> At the end of each sink loop, it should add dir to env->directories. The
> result is that free_env never frees dirs as
> it has no reference for them.
>
>
> File-sync/src/file.c at conv_plain_to_file:
>
> file->path = osync_rand_str(g_random_int_range(1, 100), error);
>
> the g_random_int_range(1, 100) returns a random number between 1 and 100.
> However, the osync_rand_str already does this. Its first argument is "int
> maxlength", which is used in:
>
> length = g_random_int_range(1, maxlength + 1);
>
> Seems to be a double random :-). It should be enough to call:
>
> file->path = osync_rand_str(100, error);
>
>
> Regards,
>
> ---
> Luiz Angelo Daros de Luca, Me.
> lui...@gm...
>
|