* [zlib] Fix CppCheck error "Shifting a negative value is undefined behaviour"
This matches what upstream now does:
https://github.com/madler/zlib/blob/
2edb94a3025d288dc251bc6cbb2c02e60fbd7438/inflate.c#L1529
* [scripts] Fix CppCheck error "Memory leak: nargv"
* [tests] Fix CppCheck error: "Memory leak: reference"
* [aot-compiler] Fix CppCheck error: "Resource leak: infile"
* [metadata] Fix CppCheck error: "Uninitialized variable: ret"
gint mib [6];
gsize size;
struct kinfo_proc *pi;
- gchar *ret;
+ gchar *ret = NULL;
#if defined(__FreeBSD__)
mib [0] = CTL_KERN;
}
}
+ fclose (infile);
acfg->profile_data = g_list_append (acfg->profile_data, data);
}
}
}
+ free (random_mem);
+ free (reference);
+ free (playground);
+
return 0;
}
if (last == NULL){
fprintf (stderr, "Do not know how to invoke the program given [%s]\n", argv [0]);
+ free (nargv);
return 1;
}
len = strlen (last) + strlen (PROFILE_BASE_DIR) + 1;
command = malloc (len);
if (command == NULL){
fprintf (stderr, "Error allocating memory");
+ free (nargv);
return 1;
}
strcpy (command, PROFILE_BASE_DIR);
{
struct inflate_state FAR *state;
- if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
+ if (strm == Z_NULL || strm->state == Z_NULL) return -(1L << 16);
state = (struct inflate_state FAR *)strm->state;
return ((long)(state->back) << 16) +
(state->mode == COPY ? state->length :