@@ -5483,8 +5483,7 @@ build_guc_variables(void)
5483
5483
for (i = 0 ; ConfigureNamesEnum [i ].gen .name ; i ++ )
5484
5484
guc_vars [num_vars ++ ] = & ConfigureNamesEnum [i ].gen ;
5485
5485
5486
- if (guc_variables )
5487
- free (guc_variables );
5486
+ free (guc_variables );
5488
5487
guc_variables = guc_vars ;
5489
5488
num_guc_variables = num_vars ;
5490
5489
size_guc_variables = size_vars ;
@@ -6880,8 +6879,7 @@ ReportGUCOption(struct config_generic *record)
6880
6879
* set last_reported to NULL and thereby possibly make a duplicate
6881
6880
* report later.
6882
6881
*/
6883
- if (record -> last_reported )
6884
- free (record -> last_reported );
6882
+ free (record -> last_reported );
6885
6883
record -> last_reported = strdup (val );
6886
6884
}
6887
6885
@@ -8356,8 +8354,7 @@ set_config_sourcefile(const char *name, char *sourcefile, int sourceline)
8356
8354
return ;
8357
8355
8358
8356
sourcefile = guc_strdup (elevel , sourcefile );
8359
- if (record -> sourcefile )
8360
- free (record -> sourcefile );
8357
+ free (record -> sourcefile );
8361
8358
record -> sourcefile = sourcefile ;
8362
8359
record -> sourceline = sourceline ;
8363
8360
}
@@ -8877,8 +8874,7 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt)
8877
8874
8878
8875
if (record -> vartype == PGC_STRING && newval .stringval != NULL )
8879
8876
free (newval .stringval );
8880
- if (newextra )
8881
- free (newextra );
8877
+ free (newextra );
8882
8878
8883
8879
/*
8884
8880
* We must also reject values containing newlines, because the
@@ -11225,12 +11221,9 @@ RestoreGUCState(void *gucstate)
11225
11221
* pointers.
11226
11222
*/
11227
11223
Assert (gconf -> stack == NULL );
11228
- if (gconf -> extra )
11229
- free (gconf -> extra );
11230
- if (gconf -> last_reported ) /* probably can't happen */
11231
- free (gconf -> last_reported );
11232
- if (gconf -> sourcefile )
11233
- free (gconf -> sourcefile );
11224
+ free (gconf -> extra );
11225
+ free (gconf -> last_reported );
11226
+ free (gconf -> sourcefile );
11234
11227
switch (gconf -> vartype )
11235
11228
{
11236
11229
case PGC_BOOL :
@@ -11261,8 +11254,7 @@ RestoreGUCState(void *gucstate)
11261
11254
{
11262
11255
struct config_string * conf = (struct config_string * ) gconf ;
11263
11256
11264
- if (* conf -> variable )
11265
- free (* conf -> variable );
11257
+ free (* conf -> variable );
11266
11258
if (conf -> reset_val && conf -> reset_val != * conf -> variable )
11267
11259
free (conf -> reset_val );
11268
11260
if (conf -> reset_extra && conf -> reset_extra != gconf -> extra )
0 commit comments