Commit c2f23b3
json: Fix uninitialized variables
In file included from ../src/nvme/json.c:17:
In function ‘freep’,
inlined from ‘json_export_nvme_tls_key’ at ../src/nvme/json.c:70:24:
../src/nvme/cleanup.h:24:9: warning: ‘tls_str’ may be used uninitialized [-Wmaybe-uninitialized]
24 | free(*(void **)p);
| ^~~~~~~~~~~~~~~~~
../src/nvme/json.c: In function ‘json_export_nvme_tls_key’:
../src/nvme/json.c:70:38: note: ‘tls_str’ was declared here
70 | _cleanup_free_ char *tls_str;
| ^~~~~~~
In function ‘freep’,
inlined from ‘json_export_nvme_tls_key’ at ../src/nvme/json.c:66:32:
../src/nvme/cleanup.h:24:9: warning: ‘key_data’ may be used uninitialized [-Wmaybe-uninitialized]
24 | free(*(void **)p);
| ^~~~~~~~~~~~~~~~~
../src/nvme/json.c: In function ‘json_export_nvme_tls_key’:
../src/nvme/json.c:66:39: note: ‘key_data’ was declared here
66 | _cleanup_free_ unsigned char *key_data;
| ^~~~~~~~
In function ‘freep’,
inlined from ‘json_import_nvme_tls_key’ at ../src/nvme/json.c:37:32,
inlined from ‘json_update_attributes’ at ../src/nvme/json.c:147:3,
inlined from ‘json_parse_port’ at ../src/nvme/json.c:177:2,
inlined from ‘json_parse_subsys’ at ../src/nvme/json.c:212:4,
inlined from ‘json_parse_host’ at ../src/nvme/json.c:246:4,
inlined from ‘json_read_config’ at ../src/nvme/json.c:316:4:
../src/nvme/cleanup.h:24:9: warning: ‘key_data’ may be used uninitialized [-Wmaybe-uninitialized]
24 | free(*(void **)p);
| ^~~~~~~~~~~~~~~~~
../src/nvme/json.c: In function ‘json_read_config’:
../src/nvme/json.c:37:39: note: ‘key_data’ was declared here
37 | _cleanup_free_ unsigned char *key_data;
| ^~~~~~~~
Signed-off-by: Tomas Bzatek <[email protected]>1 parent 4afd05f commit c2f23b3
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
0 commit comments