Skip to content

Commit

Permalink
thumbtable: Use calloc to ensure initialization.
Browse files Browse the repository at this point in the history
Fix potential issue with comparing with imgs[0] below.
  • Loading branch information
TurboGit committed Jan 29, 2024
1 parent 86c751e commit 47c8ead
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dtgtk/thumbtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ static void _event_dnd_get(GtkWidget *widget,
const int imgs_nb = g_list_length(table->drag_list);
if(imgs_nb)
{
dt_imgid_t *imgs = malloc(sizeof(dt_imgid_t) * imgs_nb);
dt_imgid_t *imgs = calloc(imgs_nb, sizeof(dt_imgid_t));
GList *l = table->drag_list;

int idx = 0;
Expand Down

0 comments on commit 47c8ead

Please sign in to comment.