Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u8XZT-006m5y-2O for pgsql-general@arkaria.postgresql.org; Sat, 26 Apr 2025 04:55:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u8XZP-000sK3-Mt for pgsql-general@arkaria.postgresql.org; Sat, 26 Apr 2025 04:55:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u8XZP-000sJv-9l for pgsql-general@lists.postgresql.org; Sat, 26 Apr 2025 04:55:20 +0000 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u8XZM-0027gE-31 for pgsql-general@lists.postgresql.org; Sat, 26 Apr 2025 04:55:19 +0000 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-601b6146b9cso1609917eaf.0 for ; Fri, 25 Apr 2025 21:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745643315; x=1746248115; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0DYlM1152pzJ62L/N/HqHX5t7+fLrmD6ZPgjxNzG+oU=; b=HNb/nMvVSs/xP1JLDDW0rgZs7mhTuKI0dmEe+6HM/ybKaYoPHLbGZVeh4xpSOwr7IR uj5lfZAz6oOIiK2iRXh9FuVVNd4QUvYKVrli+kh1Aba5ZQBlZoCasyfqB7cIQxI3KPs3 8WZ2sYzHTgeodezslccsAyR+24ci9D026GikK6f+4GTvs9XzDIJsBSRJEZ7YTDS1Ad2x lr6Lv/RXujycWlzRiSxCE3VX+y1CSbR9kzofYuD2zK9VrdprwxYTI61mZA2nFBdD+Ki0 GBLM95aen3yxsAA9Df10IUKwPbrZqRR/ND78v0okShlObZJeyNdkkPylUiOM1ZSJQNk9 Q19w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745643315; x=1746248115; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0DYlM1152pzJ62L/N/HqHX5t7+fLrmD6ZPgjxNzG+oU=; b=Rbi7E40+Fk39dKnpq8isDjs+XhQeMPNcwTi/qGLqWoFDHgslrrD1SQQvNm0+jnCaDP ODIxreVZ5SVy2NhaIzaMho3X9lIJsxpBg1QB06SwRiWk7CCv98SMWzeStEk69DEn8P/1 76WzygagVmaSTjw9y/YvdztfojC8i3cg9wg/u/+tEGjsUtRDhyqpMLUg6hELXLR5Ir1X WKc40w2i3eAfh7BPzrvL+EGmO8oBqKAq03qmFXNzU+JQVTC+XN+OiGcuL5Wpdb2WjWrN qIy165WAsMHF7a2KHR7yPl3Q48FcovmPkCHaBopI/2yKIvVRlEfv/n7pyvp5tuoCYP5N 2z2Q== X-Gm-Message-State: AOJu0YwSjivM+xGDC4qY5KUXuYnGvytj7E8NF15rluq0bxAC/ns3fztD yHNiA1jl+yVo+FvM/io9FflRgv0PYg0yWeBzES+aKNrOBo2a5lyxvvgK2wkToy5GWDngI2NUF7G Cmc9rjt5+cqfk9ymp5sHSic8/gJc= X-Gm-Gg: ASbGncvompE4oYGHtUG+q6Y78BFAcamNsKmQpk2/5aLpQ5Cx9XLg/v2imL1fvPMh40G kt1NeUsxhKtjxE7rVzI0Pp1yxV+fs9bVi7pisLM0m6QA5q9MISWWsesxiTo2GY42BRfzbFO/67q V1jguFpBm1l3G6N0Q58Eo6 X-Google-Smtp-Source: AGHT+IFWk8yNA3MvUmKngfpCtMmDOg3CHsr3hDAb3Xl96u2QsGEkNLdN9lvU1VWlzh+cE+WEop0QO/3Wzfs8Wyg99Ik= X-Received: by 2002:a05:6871:5814:b0:2d8:5015:1a90 with SMTP id 586e51a60fabf-2d9be484976mr1250582fac.2.1745643315428; Fri, 25 Apr 2025 21:55:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6802:1e0e:b0:589:13f9:e937 with HTTP; Fri, 25 Apr 2025 21:55:14 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Fri, 25 Apr 2025 21:55:14 -0700 X-Gm-Features: ATxdqUEgfeR34eyHAGRCnEE0TriAXGipqhKZOHhOs5KwTQRFLJrmRE4pANe6q7U Message-ID: Subject: How to properly fix memory leak To: Igor Korot Cc: "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000b882aa0633a7411c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b882aa0633a7411c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Friday, April 25, 2025, Igor Korot wrote: > > And the error case was handled correctly, right? > Seems like answering that requires knowing what the query is or can be. I also have no idea what idiomatic code looks like. Though, I=E2=80=99d prob= ably use PQresultErrorMessage and check affirmatively for the tuples and error cases and have a final else should the status be something unexpected. David J. --000000000000b882aa0633a7411c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Friday, April 25, 2025, Igor Korot <ikorot01@gmail.com> wrote:

And the error case was handled correctly, right?

Seems like answering that requires knowing= what the query is or can be.=C2=A0 I also have no idea what idiomatic code= looks like.=C2=A0 Though, I=E2=80=99d probably use PQresultErrorMessage an= d check affirmatively for the tuples and error cases and have a final else = should the status be something unexpected.

David J= .

--000000000000b882aa0633a7411c--