Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit77b68e3

Browse files
committed
Fix copy-pasto in freeing memory on error in vacuumlo.
It's harmless to call PQfreemem() with a NULL argument, so the onlyconsequence was that if allocating 'schema' failed, but allocating 'table'or 'field' succeeded, we would leak a bit of memory. That's highlyunlikely to happen, so this is just academical, but let's get it right.Per bug #15838 from Timur Birsh. Backpatch back to 9.5, where thePQfreemem() calls were introduced.Discussion:https://www.postgresql.org/message-id/15838-3221652c72c5e69d@postgresql.org
1 parenta36c84c commit77b68e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎contrib/vacuumlo/vacuumlo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ vacuumlo(const char *database, const struct _param *param)
243243
PQfinish(conn);
244244
if (schema!=NULL)
245245
PQfreemem(schema);
246-
if (schema!=NULL)
246+
if (table!=NULL)
247247
PQfreemem(table);
248-
if (schema!=NULL)
248+
if (field!=NULL)
249249
PQfreemem(field);
250250
return-1;
251251
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp