From patchwork Fri May 7 17:47:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Unitialized variable in mount.cifs error path Date: Fri, 07 May 2010 07:47:11 -0000 From: Steve French X-Patchwork-Id: 51940 Message-Id: To: Jeff Layton , linux-cifs-client@lists.samba.org diff --git a/mount.cifs.c b/mount.cifs.c index c4eb59a..124be27 100644 --- a/mount.cifs.c +++ b/mount.cifs.c @@ -559,7 +606,7 @@ static int open_cred_file(char *file_name, struct parsed_mount_info *parsed_info) { char *line_buf; - char *temp_val; + char *temp_val = NULL; FILE *fs = NULL; int i; const int line_buf_size = 4096; @@ -622,9 +669,10 @@ static int open_cred_file(char *file_name, break; case CRED_UNPARSEABLE: if (parsed_info->verboseflag) - fprintf(stderr, - "Credential formatted incorrectly: %s", - temp_val); + if (temp_val) + fprintf(stderr, + "Credential formatted incorrectly: %s", + temp_val); break; } }