From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127935 invoked by alias); 12 Aug 2015 17:46:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 127925 invoked by uid 89); 12 Aug 2015 17:46:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f172.google.com Received: from mail-ig0-f172.google.com (HELO mail-ig0-f172.google.com) (209.85.213.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 12 Aug 2015 17:45:59 +0000 Received: by igbpg9 with SMTP id pg9so18967209igb.0 for ; Wed, 12 Aug 2015 10:45:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=xNrR6HLUIRAsbwSBB8+7Ee6w+EG4hSMXyvDhBSKKIXE=; b=gbhOc9nT+WCfPgti2yVK3u2IJoVtinsL+C1cH7HvbEAoZcLlcyyP8eG6y0VKgmRaVb vrHbtxJY53kxM/9RQp1sSHfSiX7gyQ8k6aswiBcI4vQp32ceZN33ET15zOZ2IMmlsRXl UaXE4JdCo3hAoLkOoYyPoC2c+r1knLLgbYaa8ys1G8ugGa3Fzeyfzu/MAyc4MHvfG9DC Hq34XYuFuZKNu7IIhHZd47CHRpFMszOD6TPKiHDIAIxC9mAhV/4HnD3PxwuT317GH35d wed9zDqub7FqNLRKSioTmMslnIBu5pPW2AyVjAJxkHl48ruCnfykaeEyaKUFQlQOtwuz Z51A== X-Gm-Message-State: ALoCoQkieB0CwMFVyZloZKtMuDvWHKu6Yl/FRr0CoHWqilj/bttjZ0vrSEl7lZLD2TAYMnPKCOOO X-Received: by 10.50.20.5 with SMTP id j5mr1885374ige.3.1439401557226; Wed, 12 Aug 2015 10:45:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.93.102 with HTTP; Wed, 12 Aug 2015 10:45:17 -0700 (PDT) In-Reply-To: <1439401110-12694-1-git-send-email-keiths@redhat.com> References: <1439401110-12694-1-git-send-email-keiths@redhat.com> From: Doug Evans Date: Wed, 12 Aug 2015 17:46:00 -0000 Message-ID: Subject: Re: [PATCH] Initialize `location' in gdbpy_decode_line To: Keith Seitz Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00308.txt.bz2 On Wed, Aug 12, 2015 at 10:38 AM, Keith Seitz wrote: > BuildBot flagged an uninitialized variable coming from one of the patches > in my recently committed locations/explicit patchset. > > The following patch fixes this. > > Ok? > > gdb/ChangeLog > > * python/python.c (gdbpy_decode_line): Initialize `location' to NULL > and only call decode_line_1 when it is non-NULL. > > diff --git a/gdb/python/python.c b/gdb/python/python.c > index c28f98b..14da62c 100644 > --- a/gdb/python/python.c > +++ b/gdb/python/python.c > @@ -730,7 +730,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args) > PyObject *result = NULL; > PyObject *return_result = NULL; > PyObject *unparsed = NULL; > - struct event_location *location; > + struct event_location *location = NULL; > > if (! PyArg_ParseTuple (args, "|s", &arg)) > return NULL; > @@ -747,7 +747,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args) > > TRY > { > - if (arg) > + if (location != NULL) > sals = decode_line_1 (location, 0, 0, 0); > else > { LGTM