ecore drm - legacy - fix coverity leak complaint

is real - in error case. fix it to make coverity happy.
fix CID 1402696
This commit is contained in:
Carsten Haitzler 2019-08-05 13:44:25 +01:00
parent ea48df482c
commit 034ef0badc
1 changed files with 2 additions and 1 deletions

View File

@ -367,7 +367,7 @@ _device_handle_key(struct libinput_device *device, struct libinput_event_keyboar
e = calloc(1, sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) +
((compose[0] != '\0') ? strlen(compose) : 0) + 3);
if (!e) return;
if (!e) goto err;
e->keyname = (char *)(e + 1);
e->key = e->keyname + strlen(keyname) + 1;
@ -394,6 +394,7 @@ _device_handle_key(struct libinput_device *device, struct libinput_event_keyboar
else
ecore_event_add(ECORE_EVENT_KEY_UP, e, NULL, NULL);
err:
if (tmp) free(tmp);
}