Fix memory leak in base62_encode()

This commit is contained in:
Martin Lund 2024-10-25 18:26:59 +02:00
parent 7e314b2cc3
commit 330e99381e
3 changed files with 4 additions and 4 deletions

View file

@ -1735,7 +1735,8 @@ GList *tty_search_for_serial_devices(void)
// Hash remaining string to get unique topology ID
unsigned long hash = djb2_hash((const unsigned char *)devices_path);
char *tid = base62_encode(hash);
char tid[5];
base62_encode(hash, tid);
free(devices_path);
// Construct the path to the device's driver symlink