Skip to content
Snippets Groups Projects
Commit 32fb9b77 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

More malloc() return checks

parent 20165689
No related branches found
No related tags found
No related merge requests found
Pipeline #7025 passed
......@@ -461,6 +461,7 @@ void docopy(void)
case CIOLIB_BUTTON_1_DRAG_END:
lines=abs(mevent.endy-mevent.starty)+1;
copybuf=malloc(((endy-starty+1)*(endx-startx+1)+1+lines*2)*4);
if (copybuf) {
outpos=0;
for(y=starty-1;y<endy;y++) {
for(x=startx-1;x<endx;x++) {
......@@ -483,6 +484,7 @@ void docopy(void)
copybuf[outpos]=0;
copytext(copybuf, strlen(copybuf));
free(copybuf);
}
restorescreen(screen);
freescreen(screen);
freescreen(sbuffer);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment