...
 
Commits (2)
......@@ -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);
}
}
......
......@@ -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)
......
......@@ -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);
......
......@@ -252,7 +252,7 @@ void sbbs_t::update_qwkroute(char *via)
break;
if(i==total_qwknodes) { /* Not in list */
if((qwknode=(struct qwknode*)realloc(qwknode,sizeof(struct qwknode)*(total_qwknodes+1)))==NULL) {
errormsg(WHERE,ERR_ALLOC,str,sizeof(struct qwknode)*(total_qwknodes+1));
errormsg(WHERE,ERR_ALLOC,node,sizeof(struct qwknode)*(total_qwknodes+1));
break;
}
total_qwknodes++;
......
......@@ -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);
}
......