Use safe wrappers wherever possible

This commit is contained in:
shdown
2015-08-03 12:50:50 +03:00
parent bc52fae15c
commit c85d16faa4
14 changed files with 31 additions and 52 deletions

View File

@ -789,12 +789,12 @@ static char *migrate_config(char *input, off_t size) {
/* read the scripts output */
int conv_size = 65535;
char *converted = malloc(conv_size);
char *converted = smalloc(conv_size);
int read_bytes = 0, ret;
do {
if (read_bytes == conv_size) {
conv_size += 65535;
converted = realloc(converted, conv_size);
converted = srealloc(converted, conv_size);
}
ret = read(readpipe[0], converted + read_bytes, conv_size - read_bytes);
if (ret == -1) {