Remove unnecessary casts in free() and pfree()
authorPeter Eisentraut <[email protected]>
Fri, 26 Aug 2022 13:55:57 +0000 (15:55 +0200)
committerPeter Eisentraut <[email protected]>
Fri, 26 Aug 2022 13:55:57 +0000 (15:55 +0200)
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/cf26e970-8e92-59f1-247a-aa265235075b%40enterprisedb.com

contrib/sepgsql/label.c
src/backend/utils/fmgr/dfmgr.c

index e4c98b7eaec79dfe2bc954c7d7220aad9bbb2f78..6e7c0d7cfff7065b5314e21e4115625591f3db91 100644 (file)
@@ -662,28 +662,28 @@ quote_object_name(const char *src1, const char *src2,
                temp = quote_identifier(src1);
                appendStringInfoString(&result, temp);
                if (src1 != temp)
-                       pfree((void *) temp);
+                       pfree(temp);
        }
        if (src2)
        {
                temp = quote_identifier(src2);
                appendStringInfo(&result, ".%s", temp);
                if (src2 != temp)
-                       pfree((void *) temp);
+                       pfree(temp);
        }
        if (src3)
        {
                temp = quote_identifier(src3);
                appendStringInfo(&result, ".%s", temp);
                if (src3 != temp)
-                       pfree((void *) temp);
+                       pfree(temp);
        }
        if (src4)
        {
                temp = quote_identifier(src4);
                appendStringInfo(&result, ".%s", temp);
                if (src4 != temp)
-                       pfree((void *) temp);
+                       pfree(temp);
        }
        return result.data;
 }
index 08fd7e1264889b5b7b913df17e23757c2d38a534..6ae6fc1556dedebeb8563c73adf9365abe5d9d38 100644 (file)
@@ -240,7 +240,7 @@ internal_load_library(const char *libname)
                if (file_scanner->handle == NULL)
                {
                        load_error = dlerror();
-                       free((char *) file_scanner);
+                       free(file_scanner);
                        /* errcode_for_file_access might not be appropriate here? */
                        ereport(ERROR,
                                        (errcode_for_file_access(),
@@ -263,7 +263,7 @@ internal_load_library(const char *libname)
 
                                /* try to close library */
                                dlclose(file_scanner->handle);
-                               free((char *) file_scanner);
+                               free(file_scanner);
 
                                /* issue suitable complaint */
                                incompatible_module_error(libname, &module_magic_data);
@@ -273,7 +273,7 @@ internal_load_library(const char *libname)
                {
                        /* try to close library */
                        dlclose(file_scanner->handle);
-                       free((char *) file_scanner);
+                       free(file_scanner);
                        /* complain */
                        ereport(ERROR,
                                        (errmsg("incompatible library \"%s\": missing magic block",