fix errors from cppcheck in amiga frontend

This commit is contained in:
Vincent Sanders 2017-03-03 19:34:11 +00:00
parent 0a8976156a
commit 30ccc06984
5 changed files with 11 additions and 3 deletions

View File

@ -305,7 +305,7 @@ static void gui_download_window_error(struct gui_download_window *dw,
static void ami_download_window_abort(void *w)
{
struct gui_download_window *dw = (struct gui_download_window *)dw;
struct gui_download_window *dw = (struct gui_download_window *)w;
download_context_abort(dw->ctx);
dw->result = AMINS_DLOAD_ABORT;
gui_download_window_done(dw);

View File

@ -110,6 +110,8 @@ void ami_drag_save(struct Window *win)
ULONG which = WBO_NONE, type;
char path[1025], dpath[1025];
path[0] = 0; /* ensure path is terminated */
ami_drag_icon_close(NULL);
ami_autoscroll = true;

View File

@ -1035,6 +1035,7 @@ static void gui_init2(int argc, char** argv)
amiga_warn_user(messages_get_errorcode(error), 0);
}
free(temp_homepage_url);
temp_homepage_url = NULL;
}
if(cli_force == true) {
@ -1115,6 +1116,7 @@ static void gui_init2(int argc, char** argv)
if(temp_homepage_url) {
sendcmd = ASPrintf("OPEN \"%s\" NEW%s", temp_homepage_url, newtab);
free(temp_homepage_url);
temp_homepage_url = NULL;
} else {
sendcmd = ASPrintf("OPEN \"%s\" NEW%s", nsoption_charp(homepage_url), newtab);
}
@ -1566,6 +1568,7 @@ static struct IBox *ami_ns_rect_to_ibox(struct gui_window_2 *gwin, const struct
if(ibox == NULL) return NULL;
if(ami_gui_get_space_box((Object *)gwin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
free(ibox);
amiga_warn_user("NoMemory", "");
return NULL;
}

View File

@ -504,9 +504,9 @@ HOOKF(void, ami_menu_item_arexx_entries, APTR, window, struct IntuiMessage *)
DevNameFromLock(lock, temp, 1024, DN_FULLPATH);
AddPart(temp, script, 1024);
ami_arexx_execute(temp);
free(temp);
UnLock(lock);
}
free(temp);
}
}
}

View File

@ -336,7 +336,10 @@ static ULONG *amiga_icon_convertcolouricon32(UBYTE *icondata, ULONG width, ULONG
if (!argbicon) return(NULL);
cmap=GetColorMap(pals1);
if(!cmap) return(NULL);
if(!cmap) {
free(argbicon);
return(NULL);
}
for(i=0;i<(width*height);i++)
{