Skip to content
Snippets Groups Projects
Commit 4a55f5b0 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix some apparent memory leaks when using file's auxdata

Nobody's really using this auxdata yet, besides echicken, so no impact for
others.
parent d1e7fda1
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -1226,6 +1226,7 @@ js_add_file(JSContext *cx, uintN argc, jsval *arglist)
JS_RESUMEREQUEST(cx, rc);
smb_freefilemem(&file);
free(extdesc);
free(auxdata);
return JS_TRUE;
}
......@@ -1305,7 +1306,8 @@ js_update_file(JSContext *cx, uintN argc, jsval *arglist)
} else {
if(file.extdesc != NULL)
truncsp(file.extdesc);
if(!readd_always && strcmp(extdesc ? extdesc : "", file.extdesc ? file.extdesc : "") == 0)
if(!readd_always && strcmp(extdesc ? extdesc : "", file.extdesc ? file.extdesc : "") == 0
&& strcmp(auxdata ? auxdata : "", file.auxdata ? file.auxdata : "") == 0)
p->smb_result = smb_putfile(&p->smb, &file);
else {
if((p->smb_result = smb_removefile(&p->smb, &file)) == SMB_SUCCESS) {
......@@ -1320,6 +1322,7 @@ js_update_file(JSContext *cx, uintN argc, jsval *arglist)
smb_freefilemem(&file);
free(filename);
free(extdesc);
free(auxdata);
return result;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment