ref: d3186edbe045c08ca40d00814d145b77a5f87f72
parent: ba2e9b7458a955713f50f331d6cd7c4baf5ee77e
author: Timothy B. Terriberry <[email protected]>
date: Tue Jan 7 11:10:22 EST 2014
Clean up some bare malloc/free calls. These should use the same macros as the rest of the code.
--- a/src/stream.c
+++ b/src/stream.c
@@ -141,7 +141,7 @@
size_t len;
len=strlen(_src);
/*Worst-case output is 1 wide character per 1 input character.*/
- dst=(wchar_t *)malloc(sizeof(*dst)*(len+1));
+ dst=(wchar_t *)_ogg_malloc(sizeof(*dst)*(len+1));
if(dst!=NULL){
size_t si;
size_t di;
@@ -218,7 +218,7 @@
}
}
/*If we got here, we encountered an illegal UTF-8 sequence.*/
- free(dst);
+ _ogg_free(dst);
return NULL;
}
OP_ASSERT(di<=len);
@@ -244,8 +244,8 @@
if(wmode==NULL)errno=EINVAL;
else if(wpath==NULL)errno=ENOENT;
else fp=_wfopen(wpath,wmode);
- free(wmode);
- free(wpath);
+ _ogg_free(wmode);
+ _ogg_free(wpath);
}
#endif
if(fp!=NULL)*_cb=*&OP_FILE_CALLBACKS;
@@ -275,8 +275,8 @@
if(wmode==NULL)errno=EINVAL;
else if(wpath==NULL)errno=ENOENT;
else fp=_wfreopen(wpath,wmode,(FILE *)_stream);
- free(wmode);
- free(wpath);
+ _ogg_free(wmode);
+ _ogg_free(wpath);
}
#endif
if(fp!=NULL)*_cb=*&OP_FILE_CALLBACKS;