Skip to content

Commit 45987aa

Browse files
committed
Remove unnecessary casts in free() and pfree()
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/cf26e970-8e92-59f1-247a-aa265235075b%40enterprisedb.com
1 parent 121d2d3 commit 45987aa

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

contrib/sepgsql/label.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,28 +662,28 @@ quote_object_name(const char *src1, const char *src2,
662662
temp = quote_identifier(src1);
663663
appendStringInfoString(&result, temp);
664664
if (src1 != temp)
665-
pfree((void *) temp);
665+
pfree(temp);
666666
}
667667
if (src2)
668668
{
669669
temp = quote_identifier(src2);
670670
appendStringInfo(&result, ".%s", temp);
671671
if (src2 != temp)
672-
pfree((void *) temp);
672+
pfree(temp);
673673
}
674674
if (src3)
675675
{
676676
temp = quote_identifier(src3);
677677
appendStringInfo(&result, ".%s", temp);
678678
if (src3 != temp)
679-
pfree((void *) temp);
679+
pfree(temp);
680680
}
681681
if (src4)
682682
{
683683
temp = quote_identifier(src4);
684684
appendStringInfo(&result, ".%s", temp);
685685
if (src4 != temp)
686-
pfree((void *) temp);
686+
pfree(temp);
687687
}
688688
return result.data;
689689
}

src/backend/utils/fmgr/dfmgr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ internal_load_library(const char *libname)
240240
if (file_scanner->handle == NULL)
241241
{
242242
load_error = dlerror();
243-
free((char *) file_scanner);
243+
free(file_scanner);
244244
/* errcode_for_file_access might not be appropriate here? */
245245
ereport(ERROR,
246246
(errcode_for_file_access(),
@@ -263,7 +263,7 @@ internal_load_library(const char *libname)
263263

264264
/* try to close library */
265265
dlclose(file_scanner->handle);
266-
free((char *) file_scanner);
266+
free(file_scanner);
267267

268268
/* issue suitable complaint */
269269
incompatible_module_error(libname, &module_magic_data);
@@ -273,7 +273,7 @@ internal_load_library(const char *libname)
273273
{
274274
/* try to close library */
275275
dlclose(file_scanner->handle);
276-
free((char *) file_scanner);
276+
free(file_scanner);
277277
/* complain */
278278
ereport(ERROR,
279279
(errmsg("incompatible library \"%s\": missing magic block",

0 commit comments

Comments
 (0)