Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pk-offline-update: Fix crash due to invalid g_auto declaration in swi…
…tch / case 'case PK_PROGRESS_TYPE_PERCENTAGE' is just a label and doesn't offer any scope as such. So, 'tmp_perc' auto variable will be allocated in the stack, but will not be initialized to 'NULL' for 'case:' statements other than 'PK_PROGRESS_TYPE_PERCENTAGE', causing GLib to consider the 'tmp_perc' garbage value as a valid memory address allocated via 'g_malloc()', triggering an invalid 'free()' causing the crash. Rather than adding a scope '{}' within 'case', and causing a huge noise in git diff, we just move the declaration to an upper scope.
- Loading branch information