projects
/
YACASL2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
メモリ管理の改善
[YACASL2.git]
/
src
/
casl2.c
diff --git
a/src/casl2.c
b/src/casl2.c
index
40001ea
..
7569f92
100644
(file)
--- a/
src/casl2.c
+++ b/
src/casl2.c
@@
-128,7
+128,7
@@
int main(int argc, char *argv[])
for(pass = FIRST; pass <= SECOND; pass++) {
if(pass == FIRST) {
create_cmdtype_code(); /* 命令と命令タイプがキーのハッシュ表を作成 */
for(pass = FIRST; pass <= SECOND; pass++) {
if(pass == FIRST) {
create_cmdtype_code(); /* 命令と命令タイプがキーのハッシュ表を作成 */
- asprop = malloc_chk(sizeof(ASPROP), "asprop");
+ asprop = malloc_chk(sizeof(ASPROP), "asprop");
/* アセンブル時のプロパティ用の領域確保 */
}
for(i = optind; i < argc; i++) {
/* データの格納開始位置 */
}
for(i = optind; i < argc; i++) {
/* データの格納開始位置 */
@@
-155,8
+155,10
@@
int main(int argc, char *argv[])
}
}
if(pass == SECOND) {
}
}
if(pass == SECOND) {
- free_cmdtype_code(); /* 命令と命令タイプがキーのハッシュ表を解放 */
freelabel(); /* ラベルハッシュ表を解放 */
freelabel(); /* ラベルハッシュ表を解放 */
+ free_chk(asprop->prog, "asprop.prog"); /* プログラム名を解放 */
+ free_chk(asprop, "asprop"); /* アセンブル時のプロパティを解放 */
+ free_cmdtype_code(); /* 命令と命令タイプがキーのハッシュ表を解放 */
}
}
if(res == true) {
}
}
if(res == true) {
@@
-174,6
+176,7
@@
int main(int argc, char *argv[])
if(cerr->num > 0) {
status = -1;
}
if(cerr->num > 0) {
status = -1;
}
+ free_chk(objfile, "objfile");
/* エラーの解放 */
freecerr();
return status;
/* エラーの解放 */
freecerr();
return status;