projects
/
platform
/
upstream
/
libvorbis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
d0f4e22
)
alloca() 'frees' memory when the function returns, not when we exit
author
Monty
<xiphmont@xiph.org>
Sat, 18 Dec 1999 18:58:20 +0000
(18:58 +0000)
committer
Monty
<xiphmont@xiph.org>
Sat, 18 Dec 1999 18:58:20 +0000
(18:58 +0000)
local scope.
Monty
svn path=/trunk/vorbis/; revision=205
vq/train.c
patch
|
blob
|
history
diff --git
a/vq/train.c
b/vq/train.c
index
29e27ae
..
7d34b46
100644
(file)
--- a/
vq/train.c
+++ b/
vq/train.c
@@
-282,7
+282,7
@@
int main(int argc,char *argv[]){
}
{
int i;
- double *b=
alloca
(cols*sizeof(double));
+ double *b=
malloc
(cols*sizeof(double));
if(start*num+dim>cols){
fprintf(stderr,"ran out of columns reading %s\n",file);
exit(1);
@@
-308,6
+308,7
@@
int main(int argc,char *argv[]){
vqext_adjdata(b,start+i*dim,dim);
vqgen_addpoint(&v,b+start+i*dim);
}
+ free(b);
}
}
fclose(in);