Mercurial > libdvdnav.hg
comparison vm/vm.c @ 438:04cb2d6e4f93 src tip
In vm_new_vm(), use the proper calloc() argument order
.. and don't derive 1 from the unrelated sizeof(char).
Fixes the scan-anaylzer "API violation" warning:
Result of 'calloc' is converted to a pointer of type 'vm_t', which is incompatible with sizeof operand type 'char'
Patch by Fabian Keil <fk AT fabiankeil DOT de>
author | rathann |
---|---|
date | Wed, 04 Dec 2013 23:02:01 +0000 |
parents | 29d4a43c8c86 |
children |
comparison
equal
deleted
inserted
replaced
437:d8ec83537d07 | 438:04cb2d6e4f93 |
---|---|
261 | 261 |
262 | 262 |
263 /* Initialisation & Destruction */ | 263 /* Initialisation & Destruction */ |
264 | 264 |
265 vm_t* vm_new_vm() { | 265 vm_t* vm_new_vm() { |
266 return (vm_t*)calloc(sizeof(vm_t), sizeof(char)); | 266 return (vm_t*)calloc(1, sizeof(vm_t)); |
267 } | 267 } |
268 | 268 |
269 void vm_free_vm(vm_t *vm) { | 269 void vm_free_vm(vm_t *vm) { |
270 vm_stop(vm); | 270 vm_stop(vm); |
271 free(vm); | 271 free(vm); |