[systemd-devel] [PATCH] networkd: Initialize variable to NULL

Tom Gundersen teg at jklm.no
Wed Nov 27 07:42:24 PST 2013


On Wed, Nov 27, 2013 at 4:28 PM, Patrik Flykt
<patrik.flykt at linux.intel.com> wrote:
> If any number of arguments are given, _cleanup_manager_free_ is used
> with unitialized memory causing a crash.
> ---
>  src/network/networkd.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/network/networkd.c b/src/network/networkd.c
> index 1d43361..360afba 100644
> --- a/src/network/networkd.c
> +++ b/src/network/networkd.c
> @@ -25,7 +25,7 @@
>  #include "networkd.h"
>
>  int main(int argc, char *argv[]) {
> -        _cleanup_manager_free_ Manager *m;
> +        _cleanup_manager_free_ Manager *m = NULL;
>          int r;
>
>          log_set_target(LOG_TARGET_AUTO);
> --
> 1.7.10.4


Thanks! Applied.

-t


More information about the systemd-devel mailing list