]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: fix build warnings
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 20 Apr 2022 15:09:33 +0000 (09:09 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 20 Apr 2022 15:09:56 +0000 (09:09 -0600)
commit6ede97e29881800dc241f3ce6cdb2d4e06d33cbd
treedca2b3973ce971d68842d4fb049cbdc5113c3758
parentca55c929e8074e630f3fd2eded96542b88ef1ad5
api.c: fix build warnings

Fix the use before initialization build warnings:

api.c: In function ‘cgroup_populate_controllers.constprop’:
api.c:1386:5: warning: ‘buf’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1386 |  if (buf)
      |     ^
api.c: In function ‘cgroup_populate_mount_points.constprop’:
api.c:1461:5: warning: ‘temp_ent’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1461 |  if (temp_ent)
      |     ^

this patch, initializes them to NULL.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/api.c