redhat analysis: proc/slab
This commit is contained in:
parent
b49055e657
commit
0ebe397345
@ -312,11 +312,13 @@ int get_slabinfo(struct slab_info **list, struct slab_stat *stats)
|
|||||||
|
|
||||||
if (!fgets(buffer, SLABINFO_VER_LEN, slabfile)) {
|
if (!fgets(buffer, SLABINFO_VER_LEN, slabfile)) {
|
||||||
fprintf(stderr, "cannot read from slabinfo\n");
|
fprintf(stderr, "cannot read from slabinfo\n");
|
||||||
|
free(slabfile);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sscanf(buffer, "slabinfo - version: %d.%d", &major, &minor) != 2) {
|
if (sscanf(buffer, "slabinfo - version: %d.%d", &major, &minor) != 2) {
|
||||||
fprintf(stderr, "not the good old slabinfo we know\n");
|
fprintf(stderr, "not the good old slabinfo we know\n");
|
||||||
|
free(slabfile);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,6 +330,7 @@ int get_slabinfo(struct slab_info **list, struct slab_stat *stats)
|
|||||||
ret = parse_slabinfo10(list, stats, slabfile);
|
ret = parse_slabinfo10(list, stats, slabfile);
|
||||||
else {
|
else {
|
||||||
fprintf(stderr, "unrecognizable slabinfo version\n");
|
fprintf(stderr, "unrecognizable slabinfo version\n");
|
||||||
|
free(slabfile);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user