mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-13 13:29:55 -05:00
fix: miss free kb_layout memory
This commit is contained in:
parent
180d75f06e
commit
4c75bb973e
3 changed files with 5 additions and 11 deletions
|
|
@ -44,11 +44,11 @@ char *get_autostart_path(char *autostart_path, unsigned int buf_size) {
|
|||
return autostart_path;
|
||||
}
|
||||
|
||||
char *get_layout_abbr(const char *full_name) {
|
||||
const char *get_layout_abbr(const char *full_name) {
|
||||
// 1. 尝试在映射表中查找
|
||||
for (int i = 0; layout_mappings[i].full_name != NULL; i++) {
|
||||
if (strcmp(full_name, layout_mappings[i].full_name) == 0) {
|
||||
return strdup(layout_mappings[i].abbr);
|
||||
return layout_mappings[i].abbr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue