diff --git a/src/USER-DPD/fix_rx.cpp b/src/USER-DPD/fix_rx.cpp
index 67b134e53e126ebf0c0f63c6d81bed49f4acb572..0d8859e1aec51449f7c3b47f57365428e206bf37 100644
--- a/src/USER-DPD/fix_rx.cpp
+++ b/src/USER-DPD/fix_rx.cpp
@@ -1677,16 +1677,10 @@ void FixRX::computeLocalTemperature()
   double wij=0.0;
   double *dpdTheta = atom->dpdTheta;
 
-  // Initialize the local density and local temperature arrays
-  if (newton_pair) {
-    sumWeights = new double[nlocal+nghost];
-    for (ii = 0; ii < nlocal+nghost; ii++)
-      sumWeights[ii] = 0.0;
-  } else {
-    sumWeights = new double[nlocal];
-    for (ii = 0; ii < nlocal; ii++)
-      dpdThetaLocal[ii] = 0.0;
-  }
+  // Initialize the local temperature weight array
+  int sumWeightsCt = nlocal + (newton_pair ? nghost : 0);
+  sumWeights = new double[sumWeightsCt];
+  memset(sumWeights, 0, sizeof(double)*sumWeightsCt);
 
   inum = pairDPDE->list->inum;
   ilist = pairDPDE->list->ilist;