Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nGc7O-0007MF-BK for pgsql-bugs@arkaria.postgresql.org; Sun, 06 Feb 2022 07:37:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nGc7N-0004JA-33 for pgsql-bugs@arkaria.postgresql.org; Sun, 06 Feb 2022 07:37:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nGc7M-0004J0-O0 for pgsql-bugs@lists.postgresql.org; Sun, 06 Feb 2022 07:37:52 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nGc7J-0002jK-97 for pgsql-bugs@lists.postgresql.org; Sun, 06 Feb 2022 07:37:51 +0000 Received: from [192.168.28.32] (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id D58BE21C38EB; Sun, 6 Feb 2022 10:37:46 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1644133066; bh=QDbSkVv3aS4mpFWG9qZKMFAZ2rgb3pN4kplL4Sf6zTw=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=Nr97WHSFdR1n480u0PHHhR6puuhPMDDGLexCDIByNxnHHibJgok/ucak6EVNKF69W VBoe06WtkSgJCD8wJJ+lthzpnqHwG+fQDm9vtYsCI+j8eoFXBFgNqVQV515F+4/hIu vKd13QUgG5gQIL9rdCtx6S/l2DKO3xMRpGZ2T9lg= Message-ID: Date: Sun, 6 Feb 2022 10:37:47 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end Content-Language: en-US To: Dilip Kumar , Masahiko Sawada Cc: andrewbille@gmail.com, PostgreSQL mailing lists References: <17385-9ee529fb091f0ce5@postgresql.org> From: Dmitry Koval In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > In if (source != PGC_S_DEFAULT) we are overwriting newval with > conf->reset_val so I think we should free the newval or can we even > avoid guc_strdup in case of (source != PGC_S_DEFAULT)? I think we can not avoid guc_strdup in case of (source != PGC_S_DEFAULT) because function call_string_check_hook() contains "free(*newval);" in PG_CATCH-section. Probably we should free the newval in block + if (source != PGC_S_DEFAULT) + { + /* Release newextra as we use reset_extra */ + if (newextra) + free(newextra); With best regards, Dmitry Koval.