Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
87d66142
Commit
87d66142
authored
4 years ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Address Coverity-reported resource leaks
Mostly in error-paths.
parent
1fc2657f
No related branches found
No related tags found
1 merge request
!463
MRC mods by Codefenix (2024-10-20)
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/sbbs3/js_global.c
+1
-0
1 addition, 0 deletions
src/sbbs3/js_global.c
src/sbbs3/jsexec.c
+2
-0
2 additions, 0 deletions
src/sbbs3/jsexec.c
src/sbbs3/msgtoqwk.cpp
+2
-2
2 additions, 2 deletions
src/sbbs3/msgtoqwk.cpp
src/sbbs3/xtrn.cpp
+3
-0
3 additions, 0 deletions
src/sbbs3/xtrn.cpp
with
8 additions
and
2 deletions
src/sbbs3/js_global.c
+
1
−
0
View file @
87d66142
...
...
@@ -745,6 +745,7 @@ js_require(JSContext *cx, uintN argc, jsval *arglist)
JSVALUE_TO_MSTRING
(
cx
,
argv
[
fnarg
],
filename
,
NULL
);
JS_ReportError
(
cx
,
"symbol '%s' not defined by script '%s'"
,
property
,
filename
);
free
(
filename
);
free
(
property
);
return
(
JS_FALSE
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/jsexec.c
+
2
−
0
View file @
87d66142
...
...
@@ -1034,6 +1034,8 @@ long js_exec(const char *fname, const char* buf, char** args)
init_debugger
(
js_runtime
,
js_cx
,
dbg_puts
,
dbg_getline
);
if
((
js_script
=
JS_CompileScript
(
js_cx
,
js_glob
,
js_buf
,
js_buflen
,
fname
==
NULL
?
NULL
:
path
,
1
))
==
NULL
)
{
lprintf
(
LOG_ERR
,
"!Error compiling script from %s"
,
path
);
if
(
js_buf
!=
buf
)
free
(
js_buf
);
return
(
-
1
);
}
if
((
diff
=
xp_timer
()
-
start
)
>
0
)
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/msgtoqwk.cpp
+
2
−
2
View file @
87d66142
...
...
@@ -484,7 +484,6 @@ long sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, smb_t* smb
size
++
;
}
free
(
buf
);
if
(
ch
!=
qwk_newline
)
{
fputc
(
qwk_newline
,
qwk_fp
);
/* make sure it ends in newline */
size
++
;
...
...
@@ -515,6 +514,7 @@ long sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, smb_t* smb
fputc
(
' '
,
qwk_fp
);
}
}
free
(
buf
);
tt
=
msg
->
hdr
.
when_written
.
time
;
if
(
localtime_r
(
&
tt
,
&
tm
)
==
NULL
)
...
...
@@ -557,7 +557,7 @@ long sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, smb_t* smb
,(
mode
&
QM_TO_QNET
)
?
'*'
:
' '
/* Net tag line */
);
fseek
(
qwk_fp
,
offset
,
SEEK_SET
);
(
void
)
fseek
(
qwk_fp
,
offset
,
SEEK_SET
);
fwrite
(
str
,
QWK_BLOCK_LEN
,
1
,
qwk_fp
);
(
void
)
fseek
(
qwk_fp
,
size
,
SEEK_CUR
);
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/xtrn.cpp
+
3
−
0
View file @
87d66142
...
...
@@ -1339,6 +1339,7 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
if
(
*
gamedir
==
0
)
{
lprintf
(
LOG_ERR
,
"No startup directory configured for DOS command-line: %s"
,
cmdline
);
fclose
(
dosemubatfp
);
return
-
1
;
}
...
...
@@ -1370,6 +1371,7 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
SAFEPRINTF2
(
str
,
"%s%s"
,
cfg
.
exec_dir
,
external_bat_fn
);
if
(
!
fexist
(
str
))
{
errormsg
(
WHERE
,
ERR_READ
,
str
,
0
);
fclose
(
dosemubatfp
);
return
(
-
1
);
}
}
...
...
@@ -1378,6 +1380,7 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
if
(
!
(
externalbatfp
=
fopen
(
externalbatsrc
,
"r"
)))
{
errormsg
(
WHERE
,
ERR_OPEN
,
externalbatsrc
,
0
);
fclose
(
dosemubatfp
);
return
(
-
1
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment