[PATCH] tevent: Do not use uninitialized tv in py_tevent_context_add_timer

Lukas Slebodnik lslebodn at fedoraproject.org
Mon Jan 21 10:12:10 UTC 2019

On (19/01/19 11:26), Douglas Bagnall via samba-technical wrote:
>[Resending, because I used the wrong from: address the first time]
>On 19/01/19 4:52 AM, Lukas Slebodnik via samba-technical wrote:
>> ehlo,
>> I could see valgrind error in python bindings
>> LS
>Yes. Good, almost.
>We are trying to switch to C99 initialisers
>(c.f. https://gitlab.com/samba-team/samba/merge_requests/198), and it would be
>even better if you could initialise callback to NULL.

Standard for C99 says:
  If there are fewer initializers in a brace-enclosed list than there are elements or members
  of an aggregate, or fewer characters in a string literal used to initialize an array of known
  size than there are elements in the array, the remainder of the aggregate shall be
  initialized implicitly the same as objects that have static storage duration.

In another word.
"{ 0 };" is a quick shorthand for setting the entire structure to zero.
And it is used in recent commits in samba

So I am not clear what is wrong from C99 POV here.


More information about the samba-technical mailing list