Ident context leak during reloading of conf files when no ident information is present in the file

Started by Haribabu kommiabout 12 years ago2 messages
#1Haribabu kommi
haribabu.kommi@huawei.com
1 attachment(s)

There is an ident context leak which is occurs during reload of configuration files when
there is no ident configuration items are present in the configuration file.

In function load_ident(), New context is allocated to store the new_parsed_lines and deletes
the old context when parsed_ident_lines are present. If no parsed_ident_lines are present then
the context is not deleted.

Patch with fix is attached in the mail. please review and let me know your suggestions.

Regards,
Hari babu.

Attachments:

ident_leak_v1.patchapplication/octet-stream; name=ident_leak_v1.patchDownload
*** a/src/backend/libpq/hba.c
--- b/src/backend/libpq/hba.c
***************
*** 2243,2250 **** load_ident(void)
  			if (newline->ident_user[0] == '/')
  				pg_regfree(&newline->re);
  		}
- 		MemoryContextDelete(parsed_ident_context);
  	}
  	parsed_ident_context = ident_context;
  	parsed_ident_lines = new_parsed_lines;
  
--- 2243,2253 ----
  			if (newline->ident_user[0] == '/')
  				pg_regfree(&newline->re);
  		}
  	}
+ 
+ 	if (parsed_ident_context != NULL)
+ 		MemoryContextDelete(parsed_ident_context);
+ 
  	parsed_ident_context = ident_context;
  	parsed_ident_lines = new_parsed_lines;
  
#2Heikki Linnakangas
hlinnakangas@vmware.com
In reply to: Haribabu kommi (#1)
Re: Ident context leak during reloading of conf files when no ident information is present in the file

On 24.10.2013 13:20, Haribabu kommi wrote:

There is an ident context leak which is occurs during reload of configuration files when
there is no ident configuration items are present in the configuration file.

In function load_ident(), New context is allocated to store the new_parsed_lines and deletes
the old context when parsed_ident_lines are present. If no parsed_ident_lines are present then
the context is not deleted.

Patch with fix is attached in the mail. please review and let me know your suggestions.

Thanks, committed.

- Heikki

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers