strcmp(&file_name[file_name_len-4], ".tpk") != 0)
continue;
- struct rpm_file *rpm = (struct rpm_file*)malloc(sizeof(rpm));
- if (rpm == NULL) {
- _E("malloc() error (%m). Report (*.so_info) may be incomplete.");
- continue;
- }
-
const char *version = headerGetString(h, RPMTAG_VERSION);
const char *release = headerGetString(h, RPMTAG_RELEASE);
const char *arch = headerGetString(h, RPMTAG_ARCH);
if (version == NULL || release == NULL || arch == NULL)
continue;
+ struct rpm_file *rpm = (struct rpm_file*)malloc(sizeof(*rpm));
+ if (rpm == NULL) {
+ _E("malloc() error (%m). Report (*.so_info) may be incomplete.");
+ continue;
+ }
+
if (asprintf(&rpm->pkg_name, "%s;%s;%s;%s",
pkg_name, version, release, arch) == -1) {
_E("asprintf() error: %m");