From patchwork Fri May 7 17:47:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 97789 Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o47HlIJI014200 for ; Fri, 7 May 2010 17:47:53 GMT Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 5E84FACFD0; Fri, 7 May 2010 11:47:19 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.8 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mail-vw0-f41.google.com (mail-vw0-f41.google.com [209.85.212.41]) by lists.samba.org (Postfix) with ESMTP id 13B1EACF6F for ; Fri, 7 May 2010 11:47:13 -0600 (MDT) Received: by vws10 with SMTP id 10so571430vws.14 for ; Fri, 07 May 2010 10:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=dZOqDkgjFeDdj+Vl5WLFmNFeHgqx81yWgRSbUR4yI8c=; b=svA1ddo8MdgEe53BehkUXURxsHuCfTZA2FmBLxcjzyStiZBMuyUKcggsc7eIv57XwH G4c2Y88JlqrtDxiFbFVQ9vfnn/yKUxLvluUfvjSLkxG5MusrqS2+PDfU7/as+rudQ2Yi jlH4gyB4e/dP4+cN22thevVNRjVvI5TYkIKmM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=UNrnLor1DohRx5YcsLwJ3qocvJycILK0quthNaz76CTvUIjGXHsVTdFu+oAY+61uUA kCMOlQkVQDbEUvZrRulNWKVvUL8qIH/tZKvCfCMyzTydJJ6wcINeLE6kfGP6DrDovEzz Tn6t0QRYdOFsJ8cJ/f58BGFeVWYIDUtaZgVSY= MIME-Version: 1.0 Received: by 10.229.234.68 with SMTP id kb4mr204271qcb.103.1273254431562; Fri, 07 May 2010 10:47:11 -0700 (PDT) Received: by 10.229.38.137 with HTTP; Fri, 7 May 2010 10:47:11 -0700 (PDT) Date: Fri, 7 May 2010 12:47:11 -0500 Message-ID: From: Steve French To: Jeff Layton , linux-cifs-client@lists.samba.org Subject: [linux-cifs-client] Unitialized variable in mount.cifs error path X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 07 May 2010 17:47:54 +0000 (UTC) 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; } }