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

Commit4a0a5f2

Browse files
committed
vacuumlo: Avoid unlikely memory leak.
Spotted by Coverity. This isn't likely to matter in practice, butthere's no harm in fixing it.Michael Paquier
1 parent59f71a0 commit4a0a5f2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎contrib/vacuumlo/vacuumlo.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@ vacuumlo(const char *database, const struct _param * param)
240240
fprintf(stderr,"Out of memory\n");
241241
PQclear(res);
242242
PQfinish(conn);
243+
if (schema!=NULL)
244+
PQfreemem(schema);
245+
if (schema!=NULL)
246+
PQfreemem(table);
247+
if (schema!=NULL)
248+
PQfreemem(field);
243249
return-1;
244250
}
245251

@@ -256,6 +262,9 @@ vacuumlo(const char *database, const struct _param * param)
256262
PQclear(res2);
257263
PQclear(res);
258264
PQfinish(conn);
265+
PQfreemem(schema);
266+
PQfreemem(table);
267+
PQfreemem(field);
259268
return-1;
260269
}
261270
PQclear(res2);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp