[SCM] BOINC packaging branch, master, updated. debian/6.10.17+dfsg-3-414-geec4d18

Steffen Moeller moeller at debian.org
Wed Mar 14 22:37:42 UTC 2012


The following commit has been merged in the master branch:
commit 759c0597469ef39bf43e17fd41b0b64ca9a05ae3
Author: Steffen Moeller <moeller at debian.org>
Date:   Fri Mar 9 14:11:28 2012 +0100

    realloc treated properly.

diff --git a/debian/patches/client_stream_realloc.patch b/debian/patches/client_stream_realloc.patch
new file mode 100644
index 0000000..9549ad6
--- /dev/null
+++ b/debian/patches/client_stream_realloc.patch
@@ -0,0 +1,38 @@
+Index: boinc/client/stream.cpp
+===================================================================
+--- boinc.orig/client/stream.cpp	2012-02-15 21:13:47.000000000 +0100
++++ boinc/client/stream.cpp	2012-03-04 16:09:33.000000000 +0100
+@@ -95,6 +95,12 @@
+   double  *a=(double *)malloc((N+OFFSET)*sizeof(double));
+   double  *b=(double *)malloc((N+OFFSET)*sizeof(double));
+   double  *c=(double *)malloc((N+OFFSET)*sizeof(double));
++  if ( !a || !b || !c ) {
++      if (a) free(a);
++      if (b) free(b);
++      if (c) free(c);
++      return;
++  }
+   double   quantum=checktick();
+   int   BytesPerWord;
+   register int j, k;
+@@ -109,10 +115,16 @@
+   int check_cache=(cache_size==0);
+   do {
+     N*=2;
+-    a=(double *)realloc(a,(N+OFFSET)*sizeof(double));
+-    b=(double *)realloc(b,(N+OFFSET)*sizeof(double));
+-    c=(double *)realloc(c,(N+OFFSET)*sizeof(double));
+-    if ( !a || !b || !c ) return;
++    double *aa=(double *)realloc(a,(N+OFFSET)*sizeof(double));
++    double *bb=(double *)realloc(b,(N+OFFSET)*sizeof(double));
++    double *cc=(double *)realloc(c,(N+OFFSET)*sizeof(double));
++    if ( !a || !b || !c ) {
++	if (aa) free(aa) else free(a);
++	if (bb) free(bb) else free(b);
++	if (cc) free(cc) else free(c);
++	return;
++    }
++    a=aa; b=bb; c=cc;
+ 
+     for (j=0; j<N; j++) {
+       a[j] = 1.0;

-- 
BOINC packaging



More information about the pkg-boinc-commits mailing list