From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6520 invoked by alias); 9 Aug 2015 17:07:57 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36026 Received: (qmail 20932 invoked from network); 9 Aug 2015 17:07:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=nFLh3Zdd7SMbX1zKVQPi49NKmQaOi1uos0Q04dfQm0I=; b=jF9d1rnurPyD6fhv3pzDCjZ99dFnAv0BXUeSqitDPOJ1Qxr9ugnHE6/4333e5Azat+ pzeEQlC85ghcrIprGf7ojoZ1RN5OFZqIX6P8GmyE8gOcwbnyf7nL2SmiUMJdyllw+7qp +GfVOW7iqcvRmfJOzdGKCNzztyLMmwDSlm4aQMd/mRPOxuNr7Jl56X98MFcniHQcRrQX xMg4Il8TvNdqs9XdB+fEOB/u7+FxLARTlgaRKNp+L0STSbgAA6Mk50MxMMRrw0y/nN+D 5L78NbIg9SNj8EAxZGpkRQcvATTXi1uI1gdh17BZVbalwyj6fVWVmcaOJeML2QEvnQdP ioFQ== X-Gm-Message-State: ALoCoQkDR8tL+vZroYrT8/Vvwl3qOLcWC2vsxtgtpKGpiT2OUw6Wj6Ly64e6bnErM/5OKfPyXrYX X-Received: by 10.182.210.234 with SMTP id mx10mr15682913obc.1.1439140070273; Sun, 09 Aug 2015 10:07:50 -0700 (PDT) From: Bart Schaefer Message-Id: <150809100743.ZM7453@torch.brasslantern.com> Date: Sun, 9 Aug 2015 10:07:43 -0700 In-Reply-To: <150808213755.ZM18793@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Crash if zsh exits with zftp module loaded" (Aug 8, 9:37pm) References: <150808213755.ZM18793@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: PATCH Re: Crash if zsh exits with zftp module loaded MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 8, 9:37pm, Bart Schaefer wrote: } } This only reproduces with a debugging malloc library that detects the } double free: So actually the problem is that the zsh/zftp module can't be loaded, then unloaded, then loaded again without crashing either at reload or somewhere else along the way. diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c index 30f5176..bd51512 100644 --- a/Src/Modules/zftp.c +++ b/Src/Modules/zftp.c @@ -3149,9 +3149,11 @@ zftp_cleanup(void) zfclose(zfsess != cursess); } zsfree(lastmsg); + lastmsg = NULL; zfunsetparam("ZFTP_SESSION"); freelinklist(zfsessions, (FreeFunc) freesession); zfree(zfstatusp, sizeof(int)*zfsesscnt); + zfstatusp = NULL; } static int