Device: Do not free init_dev if points to dev, fixes SIGTRAP.

This commit is contained in:
OBattler
2024-05-25 02:02:55 +02:00
parent a614e935fb
commit 44a6e7c1b4

View File

@@ -137,7 +137,7 @@ device_context_restore(void)
static void *
device_add_common(const device_t *dev, void *p, void *params, int inst)
{
device_t *init_dev;
device_t *init_dev = NULL;
void *priv = NULL;
int c;
@@ -204,6 +204,7 @@ device_add_common(const device_t *dev, void *p, void *params, int inst)
} else
device_priv[c] = p;
if (init_dev != dev)
free(init_dev);
return priv;