Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
neochapay committed Jan 11, 2022
1 parent 473b789 commit 40b1ca2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/usb_moded-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,9 +1068,15 @@ char * config_get_android_manufacturer(void)

// Create a new GKeyFile object and a bitwise list of flags.
hwReleaseFile = g_key_file_new();
if (g_key_file_load_from_file(hwReleaseFile, "/etc/hw-release", G_KEY_FILE_NONE, &error)) {
if (g_key_file_load_from_file(hwReleaseFile, "/etc/hw-release", G_KEY_FILE_NONE, &error))
{
return g_key_file_get_string(hwReleaseFile, NULL, "MANUFACTURER", NULL);
}
else
{
g_free(hwReleaseFile);
return "n/a";
}
#endif

return config_get_conf_string(ANDROID_ENTRY, ANDROID_MANUFACTURER_KEY);
Expand Down

0 comments on commit 40b1ca2

Please sign in to comment.