All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] do not pass NULL to strdup.
@ 2011-02-02 15:34 Gleb Natapov
  2011-02-02 17:04 ` Markus Armbruster
  2011-02-04 20:23 ` Aurelien Jarno
  0 siblings, 2 replies; 3+ messages in thread
From: Gleb Natapov @ 2011-02-02 15:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: armbru

Also use qemu_strdup() instead of strdup() in bootindex code.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
---

Should go to stable too.

diff --git a/vl.c b/vl.c
index 655617f..ed2cdfa 100644
--- a/vl.c
+++ b/vl.c
@@ -738,7 +738,7 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
 
     node = qemu_mallocz(sizeof(FWBootEntry));
     node->bootindex = bootindex;
-    node->suffix = strdup(suffix);
+    node->suffix = suffix ? qemu_strdup(suffix) : NULL;
     node->dev = dev;
 
     QTAILQ_FOREACH(i, &fw_boot_order, link) {
@@ -785,7 +785,7 @@ char *get_boot_devices_list(uint32_t *size)
         } else if (devpath) {
             bootpath = devpath;
         } else {
-            bootpath = strdup(i->suffix);
+            bootpath = qemu_strdup(i->suffix);
             assert(bootpath);
         }
 
--
			Gleb.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] do not pass NULL to strdup.
  2011-02-02 15:34 [Qemu-devel] [PATCH] do not pass NULL to strdup Gleb Natapov
@ 2011-02-02 17:04 ` Markus Armbruster
  2011-02-04 20:23 ` Aurelien Jarno
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Armbruster @ 2011-02-02 17:04 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: qemu-devel

Gleb Natapov <gleb@redhat.com> writes:

> Also use qemu_strdup() instead of strdup() in bootindex code.
>
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> ---
>
> Should go to stable too.

Yes, please!  By the way, putting 0.14 in the subject should help with
that.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] do not pass NULL to strdup.
  2011-02-02 15:34 [Qemu-devel] [PATCH] do not pass NULL to strdup Gleb Natapov
  2011-02-02 17:04 ` Markus Armbruster
@ 2011-02-04 20:23 ` Aurelien Jarno
  1 sibling, 0 replies; 3+ messages in thread
From: Aurelien Jarno @ 2011-02-04 20:23 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: qemu-devel, armbru

On Wed, Feb 02, 2011 at 05:34:34PM +0200, Gleb Natapov wrote:
> Also use qemu_strdup() instead of strdup() in bootindex code.
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> ---
> 
> Should go to stable too.

Thanks, applied

> diff --git a/vl.c b/vl.c
> index 655617f..ed2cdfa 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -738,7 +738,7 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev,
>  
>      node = qemu_mallocz(sizeof(FWBootEntry));
>      node->bootindex = bootindex;
> -    node->suffix = strdup(suffix);
> +    node->suffix = suffix ? qemu_strdup(suffix) : NULL;
>      node->dev = dev;
>  
>      QTAILQ_FOREACH(i, &fw_boot_order, link) {
> @@ -785,7 +785,7 @@ char *get_boot_devices_list(uint32_t *size)
>          } else if (devpath) {
>              bootpath = devpath;
>          } else {
> -            bootpath = strdup(i->suffix);
> +            bootpath = qemu_strdup(i->suffix);
>              assert(bootpath);
>          }
>  
> --
> 			Gleb.
> 
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-04 20:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02 15:34 [Qemu-devel] [PATCH] do not pass NULL to strdup Gleb Natapov
2011-02-02 17:04 ` Markus Armbruster
2011-02-04 20:23 ` Aurelien Jarno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.