fix another unchecked malloc

<joeyh> any parrticular reason 12?
<igli> well maximum a 32-bit can go is 10 chars
<igli> so one for \0 and round up to 4
master
Joey Hess 2015-01-25 00:10:34 -04:00
parent b0861d8162
commit 6a46c2cf55
1 changed files with 1 additions and 1 deletions

View File

@ -200,7 +200,7 @@ void addenv(char *var, char *val) {
} }
void set_cgilock_fd (int lockfd) { void set_cgilock_fd (int lockfd) {
char *fd_s=malloc(8); char fd_s[12];
sprintf(fd_s, "%i", lockfd); sprintf(fd_s, "%i", lockfd);
if (setenv("IKIWIKI_CGILOCK_FD", fd_s, 1) != 0) { if (setenv("IKIWIKI_CGILOCK_FD", fd_s, 1) != 0) {
perror("setenv"); perror("setenv");