)]}'
{
  "commit": "3284d1c07cfd8d42aa27d1cf83d3e65fcd62e35e",
  "tree": "cf8bbab99b9ccef4fec6d7bfcc7ec17a3dde924b",
  "parents": [
    "f905be62379aab0c5874756e1a73b33581d7011d"
  ],
  "author": {
    "name": "Peter Maydell",
    "email": "peter.maydell@linaro.org",
    "time": "Thu Aug 21 16:44:59 2025 +0100"
  },
  "committer": {
    "name": "Philippe Mathieu-Daudé",
    "email": "philmd@linaro.org",
    "time": "Tue Sep 02 17:57:05 2025 +0200"
  },
  "message": "hw/gpio/pca9554: Avoid leak in pca9554_set_pin()\n\nIn pca9554_set_pin() we have a string property which we parse in\norder to set some non-string fields in the device state.  So we call\nvisit_type_str(), passing it the address of the local variable\nstate_str.\n\nvisit_type_str() will allocate a new copy of the string; we\nnever free this string, so the result is a memory leak, detected\nby ASAN during a \"make check\" run:\n\nDirect leak of 5 byte(s) in 1 object(s) allocated from:\n    #0 0x5d605212ede3 in malloc (/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/qemu-system-arm+0x21f1de3) (\nBuildId: 3d5373c89317f58bfcd191a33988c7347714be14)\n    #1 0x7f7edea57b09 in g_malloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x62b09) (BuildId: 1eb6131419edb83b2178b68282\n9a6913cf682d75)\n    #2 0x7f7edea6d4d8 in g_strdup (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x784d8) (BuildId: 1eb6131419edb83b2178b68282\n9a6913cf682d75)\n    #3 0x5d6055289a91 in g_strdup_inline /usr/include/glib-2.0/glib/gstrfuncs.h:321:10\n    #4 0x5d6055289a91 in qobject_input_type_str /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qapi/qo\nbject-input-visitor.c:542:12\n    #5 0x5d605528479c in visit_type_str /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qapi/qapi-visit\n-core.c:349:10\n    #6 0x5d60528bdd87 in pca9554_set_pin /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../hw/gpio/pca9554.c:179:10\n    #7 0x5d60549bcbbb in object_property_set /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qom/object.c:1450:5\n    #8 0x5d60549d2055 in object_property_set_qobject /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qom/qom-qobject.c:28:10\n    #9 0x5d60549bcdf1 in object_property_set_str /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qom/object.c:1458:15\n    #10 0x5d605439d077 in gb200nvl_bmc_i2c_init /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../hw/arm/aspeed.c:1267:5\n    #11 0x5d60543a3bbc in aspeed_machine_init /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../hw/arm/aspeed.c:493:9\n\nMake the state_str g_autofree, so that we will always free\nit, on both error-exit and success codepaths.\n\nCc: qemu-stable@nongnu.org\nFixes: de0c7d543bca (\"misc: Add a pca9554 GPIO device model\")\nSigned-off-by: Peter Maydell \u003cpeter.maydell@linaro.org\u003e\nReviewed-by: Glenn Miles \u003cmilesg@linux.ibm.com\u003e\nReviewed-by: Philippe Mathieu-Daudé \u003cphilmd@linaro.org\u003e\nMessage-ID: \u003c20250821154459.2417976-1-peter.maydell@linaro.org\u003e\nSigned-off-by: Philippe Mathieu-Daudé \u003cphilmd@linaro.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "de3f883aee933297059df247642c8def175633f8",
      "old_mode": 33188,
      "old_path": "hw/gpio/pca9554.c",
      "new_id": "eac0d23be34a59b301327af2a17034f4539f2377",
      "new_mode": 33188,
      "new_path": "hw/gpio/pca9554.c"
    }
  ]
}
