Project

General

Profile

Actions

Bug #4307

closed

Variable is used before it is initialized in kwarndtest.c

Added by Ilya Usvyatsky about 8 years ago. Updated about 8 years ago.

Status:
Resolved
Priority:
Normal
Category:
cmd - userland programs
Start date:
2013-11-08
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

gcc -Wuinitialized complains about
https://github.com/illumos/illumos-gate/blob/master/usr/src/cmd/krb5/kwarn/kwarndtest.c#L99

Quick analysis reveals that indeed argv_array is passed into FREE uninitialized.
The correct variable to pass into FREE is argv, so the whole string should look like

FREE(argv, (argc+1)*sizeof (char *));

Related issues

Has duplicate illumos gate - Bug #4119: Mistake in kwarndtest breaks the buildClosed2013-09-08

Actions
Actions

Also available in: Atom PDF